Method Get
Get()
Returns the byte at the current position and increases the position by 1.
Declaration
public abstract byte Get()
Returns
Type | Description |
---|---|
System.Byte | the byte at the current position. |
Exceptions
Type | Condition |
---|---|
BufferUnderflowException | if the position is equal or greater than limit. |
Get(Byte[])
Reads bytes from the current position into the specified byte array and increases the position by the number of bytes read.
Calling this method has the same effect as
Get(dest, 0, dest.Length)
.
Declaration
public virtual ByteBuffer Get(byte[] dest)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dest | the destination byte array. |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferUnderflowException | if |
Get(Byte[], Int32, Int32)
Reads bytes from the current position into the specified byte array, starting at the specified offset, and increases the position by the number of bytes read.
Declaration
public virtual ByteBuffer Get(byte[] dest, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dest | the target byte array. |
System.Int32 | off | the offset of the byte array, must not be negative and
not greater than |
System.Int32 | len | the number of bytes to read, must not be negative and not
greater than |
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
BufferUnderflowException | if |
Get(Int32)
Returns the byte at the specified index and does not change the position.
Declaration
public abstract byte Get(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | the index, must not be negative and less than limit. |
Returns
Type | Description |
---|---|
System.Byte | the byte at the specified index. |