Diffusion .NET Client Library
6.1.5
|
The collection of methods for converting an array of bytes to one of the base data types, as well as for converting a base data type to an array of bytes. More...
Static Public Member Functions | |
static unsafe void | GetBytes (short value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 16-bit signed integer value into the given byte array. More... | |
static byte[] | GetBytes (short value, ByteOrder resultByteOrder) |
Returns the specified 16-bit signed integer value as an array of bytes. More... | |
static void | GetBytes (char value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 16-bit character value into the given byte array. More... | |
static byte[] | GetBytes (char value, ByteOrder resultByteOrder) |
Returns the specified 16-bit character value as an array of bytes. More... | |
static unsafe void | GetBytes (int value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 32-bit signed integer value into the given byte array. More... | |
static byte[] | GetBytes (int value, ByteOrder resultByteOrder) |
Returns the specified 32-bit signed integer value as an array of bytes. More... | |
static unsafe void | GetBytes (long value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 64-bit signed integer value into the given byte array. More... | |
static byte[] | GetBytes (long value, ByteOrder resultByteOrder) |
Returns the specified 64-bit signed integer value as an array of bytes. More... | |
static void | GetBytes (ushort value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 16-bit unsigned integer value into the given byte array. More... | |
static byte[] | GetBytes (ushort value, ByteOrder resultByteOrder) |
Returns the specified 16-bit unsigned integer value as an array of bytes. More... | |
static void | GetBytes (uint value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 32-bit unsigned integer value into the given byte array. More... | |
static byte[] | GetBytes (uint value, ByteOrder resultByteOrder) |
Returns the specified 32-bit unsigned integer value as an array of bytes. More... | |
static void | GetBytes (ulong value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 64-bit unsigned integer value into the given byte array. More... | |
static byte[] | GetBytes (ulong value, ByteOrder resultByteOrder) |
Returns the specified 64-bit unsigned integer value as an array of bytes. More... | |
static unsafe void | GetBytes (float value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 32-bit floating point value into the given byte array. More... | |
static unsafe byte[] | GetBytes (float value, ByteOrder resultByteOrder) |
Returns the specified 32-bit floating point value as an array of bytes. More... | |
static unsafe void | GetBytes (double value, byte[] result, int offset, ByteOrder resultByteOrder) |
Writes the specified 64-bit floating point value into the given byte array. More... | |
static unsafe byte[] | GetBytes (double value, ByteOrder resultByteOrder) |
Returns the specified 64-bit floating point value as an array of bytes. More... | |
static char | ToChar (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 16-bit character converted from two bytes at a specified position in a byte array. More... | |
static unsafe short | ToInt16 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. More... | |
static unsafe int | ToInt32 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. More... | |
static unsafe long | ToInt64 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. More... | |
static ushort | ToUInt16 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. More... | |
static uint | ToUInt32 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. More... | |
static ulong | ToUInt64 (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. More... | |
static float | ToHalf (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 16-bit floating point converted from eight bytes at a specified position in a byte array. More... | |
static unsafe float | ToSingle (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 32-bit floating point converted from eight bytes at a specified position in a byte array. More... | |
static unsafe double | ToDouble (byte[] value, int offset, ByteOrder valueByteOrder) |
Returns a 64-bit floating point converted from eight bytes at a specified position in a byte array. More... | |
Static Public Attributes | |
static ByteOrder | SystemByteOrder |
Returns the byte order of the current architecture. More... | |
The collection of methods for converting an array of bytes to one of the base data types, as well as for converting a base data type to an array of bytes.
All methods are able to distinguish between little-endian and big-endian byte ordering.
|
static |
Writes the specified 16-bit signed integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 16-bit signed integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 16-bit character value into the given byte array.
value | The value to convert. |
result | The byte array to write the character to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 16-bit character value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 32-bit signed integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 32-bit signed integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 64-bit signed integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 64-bit signed integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 16-bit unsigned integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 16-bit unsigned integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 32-bit unsigned integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 32-bit unsigned integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 64-bit unsigned integer value into the given byte array.
value | The value to convert. |
result | The byte array to write the integer to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 64-bit unsigned integer value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 32-bit floating point value into the given byte array.
value | The value to convert. |
result | The byte array to write the floating point to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 32-bit floating point value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Writes the specified 64-bit floating point value into the given byte array.
value | The value to convert. |
result | The byte array to write the floating point to. |
offset | The starting index of the result buffer. |
resultByteOrder | The byte order for the resulting array. |
ArgumentNullException | The given result array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given result array. |
|
static |
Returns the specified 64-bit floating point value as an array of bytes.
value | The value to convert. |
resultByteOrder | The byte order for the resulting array. |
|
static |
Returns a 16-bit character converted from two bytes at a specified position in a byte array.
value | The byte array to read the character from. |
offset | The starting index of the character within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 64-bit floating point converted from eight bytes at a specified position in a byte array.
value | The byte array to read the floating point from. |
offset | The starting index of the floating point within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 16-bit floating point converted from eight bytes at a specified position in a byte array.
value | The byte array to read the floating point from. |
offset | The starting index of the floating point within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 32-bit floating point converted from eight bytes at a specified position in a byte array.
value | The byte array to read the floating point from. |
offset | The starting index of the floating point within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.
value | The byte array to read the integer from. |
offset | The starting index of the integer within the byte array. |
valueByteOrder | The byte order of the given byte array. |
ArgumentNullException | The given array is null . |
ArgumentOutOfRangeException | The given offset is negative or bigger than the given array. |
|
static |
Returns the byte order of the current architecture.