Method Put
Put(Byte)
Writes the given byte to the current position and increases the position by 1.
Declaration
public abstract ByteBuffer Put(byte b)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | b | the byte to write. |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferOverflowException | if position is equal or greater than limit. |
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |
Put(Byte[])
Writes bytes in the given byte array to the current position and increases the position by the number of bytes written.
Calling this method has the same effect as
Put(src, 0, src.Length)
.
Declaration
public ByteBuffer Put(byte[] src)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | src | the source byte array. |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferOverflowException | if Remaining is less than |
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |
Put(Byte[], Int32, Int32)
Writes bytes in the given byte array, starting from the specified offset, to the current position and increases the position by the number of bytes written.
Declaration
public virtual ByteBuffer Put(byte[] src, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | src | the source byte array. |
System.Int32 | off | the offset of byte array, must not be negative and not greater
than |
System.Int32 | len | the number of bytes to write, must not be negative and not
greater than |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferOverflowException | if Remaining is less than |
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |
Put(ByteBuffer)
Writes all the remaining bytes of the src
byte buffer to this
buffer's current position, and increases both buffers' position by the
number of bytes copied.
Declaration
public virtual ByteBuffer Put(ByteBuffer src)
Parameters
Type | Name | Description |
---|---|---|
ByteBuffer | src | the source byte buffer. |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferOverflowException | if |
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |
Put(Int32, Byte)
Write a
Declaration
public abstract ByteBuffer Put(int index, byte b)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | the index, must not be negative and less than the limit. |
System.Byte | b | the |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |