![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
This class represents a byte buffer. More...
Public Member Functions | |
ByteBuffer () | |
Constructor. More... | |
ByteBuffer (bool autoExpand) | |
Constructor. More... | |
ByteBuffer (int desiredSize) | |
Constructor. More... | |
ByteBuffer (int desiredSize, bool autoExpand) | |
Constructor. More... | |
ByteBuffer (byte[] buffer) | |
Constructs a new ByteBuffer object without incrementing the position. More... | |
ByteBuffer (byte[] buffer, bool setPosition, bool autoExpand) | |
Constructor. More... | |
ByteBuffer (ByteBuffer buffer) | |
Creates a ByteBuffer from a source ByteBuffer. More... | |
ByteBuffer (byte[] buffer, int desiredSize) | |
Creates a ByteBuffer from an array of bytes of the desired size. Note: does not increment the current position. More... | |
ByteBuffer (object expand) | |
Constructor. More... | |
override string | ToString () |
ByteBuffer | GetRemainder () |
Returns the remaining bytes in this buffer as a new buffer. It would be prudent to call 'HasRemaining' prior to calling this. More... | |
string | ToHexString () |
Return a string summarizing the state of this buffer. More... | |
string | ToDecimalString () |
Returns a string representing the decimal values of this ByteBuffer. More... | |
bool | Contains (byte byteToFind) |
Helper method to scan the byte array for a particular byte. More... | |
ByteBuffer | AsReadOnlyBuffer () |
Creates a readonly version of the current byte buffer. More... | |
![]() | |
virtual void | Acquire () |
ByteBufferBase | Clear () |
Resets the limit to the length and sets the position to zero. More... | |
ByteBufferBase | Compact () |
Compact this buffer. More... | |
ByteBufferBase | Expand (int expectedRemaining) |
Expand the buffer. More... | |
ByteBufferBase | Expand (int position, int expectedRemaining) |
Expand the buffer. More... | |
ByteBufferBase | Flip () |
Sets the limit to the position, and sets the position to 0. More... | |
byte | Get () |
Gets the byte from the current position. More... | |
byte | Get (int position) |
Gets the byte at a given position. More... | |
void | Get (byte[] buffer) |
Gets the buffer. More... | |
void | Get (byte[] buffer, int offset, int length) |
Gets the buffer. More... | |
void | Get (int position, byte[] buffer, int offset, int length) |
Gets the buffer. More... | |
void | Get (int position, ByteBuffer buffer, int offset, int length) |
Gets the buffer. More... | |
char | GetChar () |
Gets a character at the current position. More... | |
char | GetChar (int position) |
Gets a character at a given position. More... | |
string | GetHexDump () |
Gets a hexadecimal dump of this buffer. More... | |
short | GetInt16 () |
Gets a short at the current position. More... | |
short | GetInt16 (int position) |
Gets a short at a given position. More... | |
int | GetInt32 () |
Gets a uint32 at the current position. More... | |
int | GetInt32 (int position) |
Gets a uint32 at a given position. More... | |
long | GetInt64 () |
Gets a uint64 at the current position. More... | |
long | GetInt64 (int position) |
Gets a uint64 at a given position. More... | |
sbyte | GetSByte () |
sbyte | GetSByte (int position) |
ushort | GetUInt16 () |
ushort | GetUInt16 (int position) |
uint | GetUInt32 () |
uint | GetUInt32 (int position) |
ulong | GetUInt64 () |
ulong | GetUInt64 (int position) |
ByteBufferBase | Put (params byte[] data) |
ByteBufferBase | PutRange (byte[] data) |
ByteBufferBase | PutRange (byte[] data, bool incrementPosition) |
ByteBufferBase | Put (ByteBufferBase data) |
ByteBufferBase | Put (byte value) |
ByteBufferBase | Put (char value) |
ByteBufferBase | PutUtf8 (string str) |
ByteBufferBase | Put (short value) |
ByteBufferBase | Put (int value) |
ByteBufferBase | Put (long value) |
ByteBufferBase | Put (sbyte value) |
ByteBufferBase | Put (ushort value) |
ByteBufferBase | Put (uint value) |
ByteBufferBase | Put (ulong value) |
ByteBufferBase | Put (byte[] buffer, bool incrementPosition) |
ByteBufferBase | Put (int position, ByteBufferBase data) |
ByteBufferBase | Put (int position, byte value) |
ByteBufferBase | Put (int position, char value) |
ByteBufferBase | Put (int position, short value) |
ByteBufferBase | Put (int position, int value) |
ByteBufferBase | Put (int position, long value) |
ByteBufferBase | Put (int position, sbyte value) |
ByteBufferBase | Put (int position, ushort value) |
ByteBufferBase | Put (int position, uint value) |
ByteBufferBase | Put (int position, ulong value) |
ByteBufferBase | Put (byte[] buffer, int offset, int length, bool incrementPosition=true) |
ByteBufferBase | Put (int position, byte[] buffer, int offset, int length) |
virtual void | Release () |
ByteBufferBase | Rewind () |
ByteBufferBase | Skip (int numBytes) |
ByteBufferBase | Slice () |
override string | ToString () |
Static Public Member Functions | |
static ByteBuffer | Allocate (int capacity) |
Allocate memory for a buffer. More... | |
static ByteBuffer | Wrap (byte[] buffer, bool setPosition=false, bool autoExpand=false) |
![]() | |
static void | SetAllocator (IByteBufferAllocator allocator) |
Protected Member Functions | |
override void | DoCompact () |
override byte | DoReadByte (int position) |
override void | DoReadBytes (int position, byte[] dest, int offset, int length) |
override void | DoResize (int newSize) |
override void | DoWrite (int position, byte value) |
override void | DoWrite (int position, byte[] src, int offset, int length) |
Properties | |
byte | this[int index] [get] |
Returns a byte at the given index. More... | |
override byte[] | Bytes [get] |
override int | Length [get] |
override int | Capacity [get] |
![]() | |
abstract byte[] | Bytes [get] |
Get the bytes in the buffer. More... | |
abstract int | Length [get] |
Get the number of bytes in the buffer. More... | |
abstract int | Capacity [get] |
Get the capacity of the buffer. More... | |
bool | HasRemaining [get] |
Do we have any bytes remaining? More... | |
bool | IsAutoExpand [get, set] |
Is this an auto-expanding buffer? More... | |
int | Limit [get, set] |
Get/set the limit of the buffer. More... | |
int | Position [get, set] |
Get/set the currently indexed position into the buffer. More... | |
int | Remaining [get] |
Returns how many bytes are remaining in the buffer. More... | |
Additional Inherited Members | |
![]() | |
static IByteBufferAllocator | THE_ALLOCATOR = new ByteBufferAllocator() |
The byte buffer allocator. More... | |
This class represents a byte buffer.
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | ) |
Constructor.
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | bool | autoExpand | ) |
Constructor.
autoExpand |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | int | desiredSize | ) |
Constructor.
desiredSize |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | int | desiredSize, |
bool | autoExpand | ||
) |
Constructor.
desiredSize | |
autoExpand |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | byte[] | buffer | ) |
Constructs a new ByteBuffer object without incrementing the position.
buffer |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | byte[] | buffer, |
bool | setPosition, | ||
bool | autoExpand | ||
) |
Constructor.
buffer | |
setPosition | |
autoExpand |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | ByteBuffer | buffer | ) |
Creates a ByteBuffer from a source ByteBuffer.
buffer |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | byte[] | buffer, |
int | desiredSize | ||
) |
Creates a ByteBuffer from an array of bytes of the desired size. Note: does not increment the current position.
buffer | |
desiredSize |
PushTechnology.DiffusionCore.Buffering.ByteBuffer.ByteBuffer | ( | object | expand | ) |
Constructor.
expand |
|
static |
Allocate memory for a buffer.
capacity | The number of bytes to allocate. |
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.AsReadOnlyBuffer | ( | ) |
Creates a readonly version of the current byte buffer.
bool PushTechnology.DiffusionCore.Buffering.ByteBuffer.Contains | ( | byte | byteToFind | ) |
Helper method to scan the byte array for a particular byte.
byteToFind |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
position | |
dest | |
offset | |
length |
Implements PushTechnology.DiffusionCore.Buffering.ByteBufferBase.
|
protectedvirtual |
newSize |
Implements PushTechnology.DiffusionCore.Buffering.ByteBufferBase.
|
protectedvirtual |
position | |
value |
Implements PushTechnology.DiffusionCore.Buffering.ByteBufferBase.
|
protectedvirtual |
position | |
src | |
offset | |
length |
Implements PushTechnology.DiffusionCore.Buffering.ByteBufferBase.
ByteBuffer PushTechnology.DiffusionCore.Buffering.ByteBuffer.GetRemainder | ( | ) |
Returns the remaining bytes in this buffer as a new buffer. It would be prudent to call 'HasRemaining' prior to calling this.
string PushTechnology.DiffusionCore.Buffering.ByteBuffer.ToDecimalString | ( | ) |
Returns a string representing the decimal values of this ByteBuffer.
string PushTechnology.DiffusionCore.Buffering.ByteBuffer.ToHexString | ( | ) |
Return a string summarizing the state of this buffer.
override string PushTechnology.DiffusionCore.Buffering.ByteBuffer.ToString | ( | ) |
|
static |
buffer | |
setPosition | |
autoExpand |
|
get |
|
get |
|
get |
|
get |
Returns a byte at the given index.
index |