Utility class for binary data. More...
Static Public Member Functions | |
static T * | AsPointer< T > (this Span< byte > source) |
Returns a pointer to a value of type T from the given byte span. More... | |
static T * | AsPointer< T > (this Span< int > source) |
Returns a pointer to a value of type T from the given int span. More... | |
static ref T | AsRef< T > (this Span< byte > source) |
Returns a managed pointer to a value of type T. More... | |
static ref T | AsRef< T > (this Span< int > source) |
Returns a managed pointer to a value of type T. More... | |
static unsafe String | BytesToHex (byte *buffer, int length, int columns=16, string rowSeparator="\n", string columnSeparator=" ") |
Converts a buffer of bytes to a hexadecimal string representation. More... | |
static unsafe string | BytesToHex (byte[] buffer, int columns=16) |
Converts a byte array to its hexadecimal string representation. More... | |
static unsafe string | BytesToHex (ReadOnlySpan< byte > buffer, int columns=16) |
Converts a byte array to its hexadecimal string representation. More... | |
static string | ByteToHex (byte value) |
Converts a byte value to its hexadecimal string representation. More... | |
static unsafe int | HexToBytes (string str, byte *buffer, int length) |
Converts a hexadecimal string to a byte array. More... | |
static T | Read< T > (this Span< byte > source) |
Reads a value of type T from the given byte span. More... | |
static T | Read< T > (this Span< int > source) |
Reads a value of type T from the given int span. More... | |
static | unsafe (int, int) HexToInts(string str |
Converts a hexadecimal string to an array of 32-bit integers. More... | |
static unsafe string | WordsToHex (int *buffer, int length, int columns=4, string rowSeparator="\n", string columnSeparator=" ") |
Converts a buffer of 32-bit integers to a hexadecimal string representation. More... | |
static string | WordsToHex (ReadOnlySpan< int > buffer, int columns=4, string rowSeparator="\n", string columnSeparator=" ") |
Converts a buffer of 32-bit integers to a hexadecimal string representation. More... | |
static unsafe string | WordsToHex (ReadOnlySpan< uint > buffer, int columns=4, string rowSeparator="\n", string columnSeparator=" ") |
Converts a buffer of 32-bit unsigned integers to a hexadecimal string representation. More... | |
static unsafe string | WordsToHex (uint *buffer, int length, int columns=4, string rowSeparator="\n", string columnSeparator=" ") |
Converts a buffer of 32-bit unsigned integers to a hexadecimal string representation. More... | |
Utility class for binary data.
|
static |
Returns a pointer to a value of type T from the given byte span.
T | The type of the value to point to. |
source | The span of bytes to get the pointer from. |
T | : | unmanaged |
|
static |
Returns a pointer to a value of type T from the given int span.
T | The type of the value to point to. |
source | The span of ints to get the pointer from. |
T | : | unmanaged |
|
static |
Returns a managed pointer to a value of type T.
T | : | unmanaged |
|
static |
Returns a managed pointer to a value of type T.
T | : | unmanaged |
|
static |
Converts a buffer of bytes to a hexadecimal string representation.
buffer | A pointer to the buffer containing the bytes to convert. |
length | The number of bytes in the buffer. |
columns | The number of columns to format the output. Default is 16. |
rowSeparator | The string to use as a row separator. Default is newline. |
columnSeparator | The string to use as a column separator. Default is a space. |
|
static |
Converts a byte array to its hexadecimal string representation.
buffer | The byte array to convert. |
columns | The number of columns to format the output. Default is 16. |
|
static |
Converts a byte array to its hexadecimal string representation.
buffer | The byte array to convert. |
columns | The number of columns to format the output. Default is 16. |
|
static |
Converts a byte value to its hexadecimal string representation.
value | The byte value to convert. |
|
static |
Converts a hexadecimal string to a byte array.
str | The hexadecimal string to convert. |
buffer | A pointer to the buffer where the bytes will be stored. |
length | The maximum number of bytes to store in the buffer. |
|
static |
Reads a value of type T from the given byte span.
T | The type of the value to read. |
source | The span of bytes to read from. |
T | : | unmanaged |
|
static |
Reads a value of type T from the given int span.
T | The type of the value to read. |
source | The span of ints to read from. |
T | : | unmanaged |
|
static |
Converts a hexadecimal string to an array of 32-bit integers.
str | The hexadecimal string to convert. |
buffer | A pointer to the buffer where the 32-bit integers will be stored. |
length | The maximum number of 32-bit integers to store in the buffer. |
|
static |
Converts a buffer of 32-bit integers to a hexadecimal string representation.
buffer | A pointer to the buffer containing the 32-bit integers to convert. |
length | The number of 32-bit integers in the buffer. |
columns | The number of columns to format the output. Default is 4. |
rowSeparator | The string to use as a row separator. Default is newline. |
columnSeparator | The string to use as a column separator. Default is a space. |
|
static |
Converts a buffer of 32-bit integers to a hexadecimal string representation.
|
static |
Converts a buffer of 32-bit unsigned integers to a hexadecimal string representation.
|
static |
Converts a buffer of 32-bit unsigned integers to a hexadecimal string representation.
buffer | A pointer to the buffer containing the 32-bit unsigned integers to convert. |
length | The number of 32-bit unsigned integers in the buffer. |
columns | The number of columns to format the output. Default is 4. |
rowSeparator | The string to use as a row separator. Default is newline. |
columnSeparator | The string to use as a column separator. Default is a space. |