Property | Type | Description | |
---|---|---|---|
BufferChunk | System | ||
ValidateIntPtr | void | ||
ValidateNonNegative | void | ||
ValidateNotZeroLength | void | ||
ValidateObject | void | ||
ValidatePointerData | void | ||
ValidateSufficientData | void | ||
ValidateSufficientSpace | void | ||
_GetFloat | float | ||
_GetInt16 | Int16 | ||
_GetInt32 | Int32 | ||
_GetUInt64 | UInt64 | ||
_SetFloat | void | ||
_SetInt16 | void | ||
_SetInt32 | void | ||
_SetUInt64 | void |
Method | Description | |
---|---|---|
BufferChunk ( byte buffer ) : System |
Constructor, create a BufferChunk using an existing byte[] without performing a memcopy
|
|
BufferChunk ( byte buffer, int index, int length ) : System |
Constructor, create a BufferChunk from its constituent parts
|
|
BufferChunk ( int size ) : System |
Constructor, create a new BufferChunk and allocate a new byte[] to hold the data.
|
|
Clear ( ) : void |
Used to zero out the data area of the BufferChunk.
|
|
Clone ( ) : object |
Creates a shallow copy (new Index and Length, duplicate reference to the same Buffer) of a BufferChunk.
|
|
Compare ( byte obj1, byte obj2 ) : bool | ||
Copy ( byte source ) : byte[] | ||
CopyFrom ( |
||
CopyTo ( |
Copy the valid data section of 'this' to the destination BufferChunk overwriting dest's previous contents This method does not allow dest's valid data section to grow or shrink (i.e. treat valid data as a fixed buffer)
|
|
CopyTo ( IntPtr destination, Int32 length ) : void | ||
Dispose ( ) : void |
Disposes the internal state of the object
|
|
GetByte ( int index ) : byte |
Retrieves 1 byte from inside the BufferChunk This method is included for consistency. It simply forwards to the indexer.
|
|
GetDouble ( int index ) : double | ||
GetFloat ( int index ) : float | ||
GetInt16 ( int index ) : Int16 |
Retrieves 2 bytes inside the BufferChunk
|
|
GetInt32 ( int index ) : int |
Retrieves 4 bytes inside the BufferChunk
|
|
GetInt64 ( int index ) : long |
Retrieves 8 bytes inside the BufferChunk
|
|
GetPaddedUInt16 ( int index ) : UInt16 | ||
GetPaddedUInt32 ( int index ) : UInt32 | ||
GetPaddedUInt64 ( int index ) : UInt64 | ||
GetUInt16 ( int index ) : UInt16 |
Retrieves 2 bytes inside the BufferChunk
|
|
GetUInt32 ( int index ) : UInt32 |
Retrieves 4 bytes inside the BufferChunk
|
|
GetUInt64 ( int index ) : UInt64 |
Retrieves 8 bytes inside the BufferChunk
|
|
GetUTF8String ( int index, int length ) : string |
Retrieves length bytes from inside the BufferChunk and converts from UTF8 string
|
|
NextBufferChunk ( int length ) : BufferChunk |
Returns a BufferChunk consisting of the next 'length' bytes of the BufferChunk instance. Automatically increments Index and decrements Length. This function is useful for iterative functions that parse through a large BufferChunk returning smaller BufferChunks
|
|
NextBufferChunkMax ( int length ) : BufferChunk |
Returns the requested amount of data, or whatever remains if length > this.length
|
|
NextByte ( ) : byte | ||
NextDouble ( ) : double | ||
NextFloat ( ) : float | ||
NextInt16 ( ) : Int16 | ||
NextInt32 ( ) : Int32 | ||
NextInt64 ( ) : Int64 | ||
NextUInt16 ( ) : UInt16 | ||
NextUInt32 ( ) : UInt32 | ||
NextUInt64 ( ) : UInt64 | ||
NextUtf8String ( int length ) : string | ||
Peek ( int index, int length ) : BufferChunk |
Create a return BufferChunk containing a subset of the data from the valid data.
|
|
Reset ( ) : void |
Reset the BufferChunk's Index and Length pointers to zero so it is ready for reuse as an empty BufferChunk. Note that the actual byte[] buffer is not reset, so the memory is not deallocated/reallocated, allowing for more efficient reuse of memory without abusing the GC
|
|
Reset ( int index, int length ) : void |
Reset the BufferChunk's Index and Length pointers to supplied values
|
|
SetByte ( int index, byte data ) : void |
Modifies 1 byte inside the BufferChunk This method is included for consistency. It simply forwards to the indexer.
|
|
SetInt16 ( int index, Int16 data ) : void |
Modifies 2 bytes inside the BufferChunk
|
|
SetInt32 ( int index, Int32 data ) : void |
Modifies 4 bytes inside the BufferChunk
|
|
SetInt64 ( int index, Int64 data ) : void |
Modifies 8 bytes inside the BufferChunk
|
|
SetPaddedUInt16 ( int index, UInt16 data ) : void | ||
SetPaddedUInt32 ( int index, UInt32 data ) : void | ||
SetPaddedUInt64 ( int index, UInt64 data ) : void | ||
SetUInt16 ( int index, UInt16 data ) : void |
Modifies 2 bytes inside the BufferChunk
|
|
SetUInt32 ( int index, UInt32 data ) : void |
Modifies 4 bytes inside the BufferChunk
|
|
SetUInt64 ( int index, UInt64 data ) : void |
Modifies 8 bytes inside the BufferChunk
|
|
SetUTF8String ( int index, string data ) : void |
Modifies UTF8.GetBytes(data) bytes inside the BufferChunk
|
|
operator ( ) : BufferChunk |
Override + and += operator to allow appending of buffers, provided there is room in the left-most BufferChunk
|
|
this ( int index ) : byte |
Indexer used to allow us to treat a BufferChunk like a byte[]. Useful when making in place modifications or reads from a BufferChunk.
|
Method | Description | |
---|---|---|
BufferChunk ( ) : System | ||
ValidateIntPtr ( IntPtr ptr ) : void | ||
ValidateNonNegative ( int val ) : void | ||
ValidateNotZeroLength ( int length ) : void | ||
ValidateObject ( object o ) : void | ||
ValidatePointerData ( int index, int length, int dataLength ) : void | ||
ValidateSufficientData ( int requested, int actual ) : void | ||
ValidateSufficientSpace ( int requested, int actual ) : void | ||
_GetFloat ( int index ) : float | ||
_GetInt16 ( int index ) : Int16 | ||
_GetInt32 ( int index ) : Int32 | ||
_GetUInt64 ( int index ) : UInt64 | ||
_SetFloat ( int index, float data ) : void | ||
_SetInt16 ( int index, Int16 data ) : void | ||
_SetInt32 ( int index, Int32 data ) : void | ||
_SetUInt64 ( int index, UInt64 data ) : void |
public BufferChunk ( byte buffer ) : System | ||
buffer | byte | byte[] to be used as the data store for the BufferChunk, /// cannot be null or zero length |
return | System |
public BufferChunk ( byte buffer, int index, int length ) : System | ||
buffer | byte | byte[] to be used as the data store for the BufferChunk |
index | int | offset at which the valid data starts |
length | int | amount of 'valid data' |
return | System |
public BufferChunk ( int size ) : System | ||
size | int | int size of the new byte[] to create, must be >= 1 |
return | System |
public static Compare ( byte obj1, byte obj2 ) : bool | ||
obj1 | byte | |
obj2 | byte | |
return | bool |
public CopyFrom ( |
||
source | ||
alength | ||
return | void |
public CopyTo ( |
||
destination | BufferChunk | |
index | int | offset in the destination BufferChunk's valid data |
return | void |
public CopyTo ( IntPtr destination, Int32 length ) : void | ||
destination | IntPtr | |
length | Int32 | |
return | void |
public GetByte ( int index ) : byte | ||
index | int | Offset into the valid data |
return | byte |
public GetInt16 ( int index ) : Int16 | ||
index | int | Offset into the valid data |
return | Int16 |
public GetInt32 ( int index ) : int | ||
index | int | Offset into the valid data |
return | int |
public GetInt64 ( int index ) : long | ||
index | int | Offset into the valid data |
return | long |
public GetPaddedUInt16 ( int index ) : UInt16 | ||
index | int | |
return | UInt16 |
public GetPaddedUInt32 ( int index ) : UInt32 | ||
index | int | |
return | UInt32 |
public GetPaddedUInt64 ( int index ) : UInt64 | ||
index | int | |
return | UInt64 |
public GetUInt16 ( int index ) : UInt16 | ||
index | int | Offset into the valid data |
return | UInt16 |
public GetUInt32 ( int index ) : UInt32 | ||
index | int | Offset into the valid data |
return | UInt32 |
public GetUInt64 ( int index ) : UInt64 | ||
index | int | Offset into the valid data |
return | UInt64 |
public GetUTF8String ( int index, int length ) : string | ||
index | int | Offset into the valid data |
length | int | |
return | string |
public NextBufferChunk ( int length ) : BufferChunk | ||
length | int | int |
return | BufferChunk |
public NextBufferChunkMax ( int length ) : BufferChunk | ||
length | int | |
return | BufferChunk |
public NextUtf8String ( int length ) : string | ||
length | int | |
return | string |
public Peek ( int index, int length ) : BufferChunk | ||
index | int | int index into the valid data area |
length | int | int length of the data to copy |
return | BufferChunk |
public Reset ( int index, int length ) : void | ||
index | int | |
length | int | |
return | void |
public SetByte ( int index, byte data ) : void | ||
index | int | Offset into the valid data |
data | byte | Value to write at index |
return | void |
public SetInt16 ( int index, Int16 data ) : void | ||
index | int | Offset into the valid data |
data | Int16 | Value to write at index |
return | void |
public SetInt32 ( int index, Int32 data ) : void | ||
index | int | Offset into the valid data |
data | Int32 | Value to write at index |
return | void |
public SetInt64 ( int index, Int64 data ) : void | ||
index | int | Offset into the valid data |
data | Int64 | Value to write at index |
return | void |
public SetPaddedUInt16 ( int index, UInt16 data ) : void | ||
index | int | |
data | UInt16 | |
return | void |
public SetPaddedUInt32 ( int index, UInt32 data ) : void | ||
index | int | |
data | UInt32 | |
return | void |
public SetPaddedUInt64 ( int index, UInt64 data ) : void | ||
index | int | |
data | UInt64 | |
return | void |
public SetUInt16 ( int index, UInt16 data ) : void | ||
index | int | Offset into the valid data |
data | UInt16 | Value to write at index |
return | void |
public SetUInt32 ( int index, UInt32 data ) : void | ||
index | int | Offset into the valid data |
data | UInt32 | Value to write at index |
return | void |
public SetUInt64 ( int index, UInt64 data ) : void | ||
index | int | Offset into the valid data |
data | UInt64 | Value to write at index |
return | void |
public SetUTF8String ( int index, string data ) : void | ||
index | int | Offset into the valid data |
data | string | Value to write at index |
return | void |