Diffusion .NET Client Library
6.1.5
|
This class represents a byte buffer. More...
Public Member Functions | |
ByteBuffer (bool autoExpand=true) | |
Creates a new ByteBuffer. More... | |
ByteBuffer (int desiredSize, bool autoExpand=true) | |
Creates a new ByteBuffer. More... | |
ByteBuffer (byte[] buffer, bool autoExpand=true) | |
Creates a new ByteBuffer. More... | |
ByteBuffer (ByteBuffer byteBuffer) | |
Creates a new ByteBuffer. More... | |
ByteBuffer | Clear () |
Resets the limit to the length and sets the position to zero. More... | |
ByteBuffer | Compact () |
Compacts this buffer. More... | |
ByteBuffer | Expand (int expectedRemaining) |
Expands the buffer. More... | |
ByteBuffer | Flip () |
Sets the limit to the position, and sets the position to 0. More... | |
ByteBuffer | Skip (int numBytes) |
Skips the given amount of bytes. More... | |
ByteBuffer | Rewind () |
Sets the buffer position to 0. More... | |
byte | Get () |
Retruns the byte from the current position. More... | |
sbyte | GetSByte () |
Returns the signed byte from the current position. More... | |
char | GetChar () |
Returns a character at the current position. More... | |
short | GetInt16 () |
Returns a short at the current position. More... | |
ushort | GetUInt16 () |
Returns a unsigned short at the current position. More... | |
int | GetInt32 () |
Returns a uint32 at the current position. More... | |
uint | GetUInt32 () |
Returns the unsigned integer at the current position. More... | |
long | GetInt64 () |
Returns a uint64 at the current position. More... | |
ulong | GetUInt64 () |
Returns a unsigned long from the current position. More... | |
void | Get (byte[] output, int offset, int length) |
Returns a segment of bytes from the current position. More... | |
ByteBuffer | Put (byte value) |
Writes a byte to the current position. More... | |
ByteBuffer | Put (sbyte value) |
Writes a signed byte to the current position. More... | |
ByteBuffer | Put (char value) |
Writes a character to the current position. More... | |
ByteBuffer | Put (short value) |
Writes a short to the current position. More... | |
ByteBuffer | Put (ushort value) |
Writes a unsigned short to the current position. More... | |
ByteBuffer | Put (int value) |
Writes a integer to the current position. More... | |
ByteBuffer | Put (uint value) |
Writes a unsigned integer to the current position. More... | |
ByteBuffer | Put (long value) |
Writes a long to the current position. More... | |
ByteBuffer | Put (ulong value) |
Writes a unsigned long to the current position. More... | |
ByteBuffer | PutUtf8 (string str) |
Writes a UTF-8 encoded string to the current position. More... | |
ByteBuffer | Put (byte[] input, int offset, int length) |
Writes a byte segment to the current position. More... | |
ByteBuffer | GetRemainder () |
Returns the remaining bytes in this buffer as a new buffer. More... | |
override string | ToString () |
Public Attributes | |
int | Remaining => limit - position |
Returns how many bytes are remaining in the buffer. More... | |
byte[] | Bytes => buffer |
Returns the underlying byte array. More... | |
int | Capacity => buffer.Length |
Returns the buffer capacity. More... | |
bool | HasRemaining => Remaining > 0 |
Returns wether the buffer has remaining bytes. More... | |
Properties | |
int | Limit [get, set] |
Gets or sets the limit of the buffer. More... | |
int | Position [get, set] |
Gets or sets the currently indexed position into the buffer. More... | |
bool | IsAutoExpand [get, set] |
Gets or sets wether the buffer is auto-expanding. More... | |
This class represents a byte buffer.
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | bool | autoExpand = true | ) |
Creates a new ByteBuffer.
autoExpand | Sets wether the buffer is expanding after it reached its limit. |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | int | desiredSize, |
bool | autoExpand = true |
||
) |
Creates a new ByteBuffer.
desiredSize | The initial size of the byte buffer. |
autoExpand | Sets wether the buffer is expanding after it reached its limit. |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | byte[] | buffer, |
bool | autoExpand = true |
||
) |
Creates a new ByteBuffer.
buffer | The backing array of the buffer. |
autoExpand | Sets wether the buffer is expanding after it reached its limit. |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | ByteBuffer | byteBuffer | ) |
Creates a new ByteBuffer.
byteBuffer | The byte buffer to base the new instance on. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Clear | ( | ) |
Resets the limit to the length and sets the position to zero.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Compact | ( | ) |
Compacts this buffer.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Expand | ( | int | expectedRemaining | ) |
Expands the buffer.
expectedRemaining | The number of bytes by which the buffer needs to grow. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Flip | ( | ) |
Sets the limit to the position, and sets the position to 0.
byte PushTechnology.DiffusionCore.Buffering.ByteBuffer.Get | ( | ) |
Retruns the byte from the current position.
void PushTechnology.DiffusionCore.Buffering.ByteBuffer.Get | ( | byte[] | output, |
int | offset, | ||
int | length | ||
) |
Returns a segment of bytes from the current position.
output | The byte array to write to. |
offset | The output index that determines the start of the write. |
length | The number of bytes to write to the output buffer. |
char PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetChar | ( | ) |
Returns a character at the current position.
short PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetInt16 | ( | ) |
Returns a short at the current position.
int PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetInt32 | ( | ) |
Returns a uint32 at the current position.
long PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetInt64 | ( | ) |
Returns a uint64 at the current position.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetRemainder | ( | ) |
Returns the remaining bytes in this buffer as a new buffer.
sbyte PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetSByte | ( | ) |
Returns the signed byte from the current position.
ushort PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetUInt16 | ( | ) |
Returns a unsigned short at the current position.
uint PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetUInt32 | ( | ) |
Returns the unsigned integer at the current position.
ulong PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetUInt64 | ( | ) |
Returns a unsigned long from the current position.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | byte | value | ) |
Writes a byte to the current position.
value | The byte to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | sbyte | value | ) |
Writes a signed byte to the current position.
value | The signed byte to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | char | value | ) |
Writes a character to the current position.
value | The character to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | short | value | ) |
Writes a short to the current position.
value | The short to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | ushort | value | ) |
Writes a unsigned short to the current position.
value | The unsigned short to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | int | value | ) |
Writes a integer to the current position.
value | The integer to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | uint | value | ) |
Writes a unsigned integer to the current position.
value | The unsigned integer to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | long | value | ) |
Writes a long to the current position.
value | The long to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | ulong | value | ) |
Writes a unsigned long to the current position.
value | The unsigned long to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Put | ( | byte[] | input, |
int | offset, | ||
int | length | ||
) |
Writes a byte segment to the current position.
input | The bytes to write to the buffer. |
offset | The start index of the segment. |
length | The length of the segment. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.PutUtf8 | ( | string | str | ) |
Writes a UTF-8 encoded string to the current position.
value | The UTF-8 encoded string to write. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Rewind | ( | ) |
Sets the buffer position to 0.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.Skip | ( | int | numBytes | ) |
Skips the given amount of bytes.
numBytes | The number of bytes to skip. |
byte [] PushTechnology.DiffusionCore.Buffering.ByteBuffer.Bytes => buffer |
Returns the underlying byte array.
int PushTechnology.DiffusionCore.Buffering.ByteBuffer.Capacity => buffer.Length |
Returns the buffer capacity.
bool PushTechnology.DiffusionCore.Buffering.ByteBuffer.HasRemaining => Remaining > 0 |
Returns wether the buffer has remaining bytes.
int PushTechnology.DiffusionCore.Buffering.ByteBuffer.Remaining => limit - position |
Returns how many bytes are remaining in the buffer.
|
getset |
Gets or sets wether the buffer is auto-expanding.
|
getset |
Gets or sets the limit of the buffer.
|
getset |
Gets or sets the currently indexed position into the buffer.