Provides utility methods for reading and writing data. More...
Static Public Member Functions | |
static unsafe int | GetByteArrayHashCode (byte *ptr, int length) |
static int | GetByteCountUtf8NoHash (string value) |
Gets the byte count of a string in UTF8 format without a hash. More... | |
static int | GetStringHashCode (string value, int maxLength) |
static int | GetWordCountString (int capacity, bool withCaching) |
Gets the word count of a string with optional caching. More... | |
static bool | ReadBoolean (int *data) |
Reads a boolean value from the provided memory location. More... | |
static unsafe int | ReadStringUtf32NoHash (int *ptr, int maxLength, out string result) |
Reads a string from the provided memory location in UTF32 format without a hash. More... | |
static unsafe int | ReadStringUtf32WithHash (int *ptr, int maxLength, ref string cache) |
Reads a string from the provided memory location in UTF32 format with a hash. More... | |
static int | ReadStringUtf8NoHash (void *source, out string result) |
Reads a string from the provided memory location in UTF8 format without a hash. More... | |
static int | VerifyRawNetworkUnwrap< T > (int actual, int maxBytes) |
Verifies the byte count of a network unwrapped object. Throws an exception if the actual byte count exceeds the maximum allowed byte count. More... | |
static int | VerifyRawNetworkWrap< T > (int actual, int maxBytes) |
Verifies the byte count of a network wrapped object. Throws an exception if the actual byte count exceeds the maximum allowed byte count. More... | |
static void | WriteBoolean (int *data, bool value) |
Writes a boolean value to the provided memory location. More... | |
static unsafe int | WriteStringUtf32NoHash (int *ptr, int maxLength, string value) |
Writes a string to the provided memory location in UTF32 format without a hash. More... | |
static unsafe int | WriteStringUtf32WithHash (int *ptr, int maxLength, string value, ref string cache) |
Writes a string to the provided memory location in UTF32 format with a hash. More... | |
static int | WriteStringUtf8NoHash (void *destination, string str) |
Writes a string to the provided memory location in UTF8 format without a hash. More... | |
Provides utility methods for reading and writing data.
|
static |
ptr | |
length |
|
static |
Gets the byte count of a string in UTF8 format without a hash.
value | The string to get the byte count of. |
|
static |
value | |
maxLength |
|
static |
Gets the word count of a string with optional caching.
capacity | The capacity of the string. |
withCaching | Indicates whether caching is used. |
|
static |
Reads a boolean value from the provided memory location.
data | The memory location to read from. |
|
static |
Reads a string from the provided memory location in UTF32 format without a hash.
ptr | The memory location to read from. |
maxLength | The maximum length of the string. |
result | The string read from the memory location. |
|
static |
Reads a string from the provided memory location in UTF32 format with a hash.
ptr | The memory location to read from. |
maxLength | The maximum length of the string. |
cache | A reference to a cache string. This will be updated with the read string if it matches the cached hashcode. |
|
static |
Reads a string from the provided memory location in UTF8 format without a hash.
source | The memory location to read from. |
result | The string read from the memory location. |
|
static |
Verifies the byte count of a network unwrapped object. Throws an exception if the actual byte count exceeds the maximum allowed byte count.
T | The type of the network unwrapped object. |
actual | The actual byte count. |
maxBytes | The maximum allowed byte count. |
|
static |
Verifies the byte count of a network wrapped object. Throws an exception if the actual byte count exceeds the maximum allowed byte count.
T | The type of the network wrapped object. |
actual | The actual byte count. |
maxBytes | The maximum allowed byte count. |
|
static |
Writes a boolean value to the provided memory location.
data | The memory location to write to. |
value | The boolean value to write. |
|
static |
Writes a string to the provided memory location in UTF32 format without a hash.
ptr | The memory location to write to. |
maxLength | The maximum length of the string. |
value | The string to write. |
|
static |
Writes a string to the provided memory location in UTF32 format with a hash.
ptr | The memory location to write to. |
maxLength | The maximum length of the string. |
value | The string to write. |
cache | A reference to a cache string. This will be updated with the trimmed value of the input string. |
|
static |
Writes a string to the provided memory location in UTF8 format without a hash.
destination | The memory location to write to. |
str | The string to write. |