Class ByteConverter
Contains various helper methods to store UInt value into byte array. The UInt value would be stored in LittleEndian format.
Inheritance
Inherited Members
Namespace: Cosmos.Common.Extensions
Assembly: Cosmos.Common.dll
Syntax
public static class ByteConverter
Methods
| Improve this Doc View SourceSetUInt16(Byte[], UInt64, UInt16)
Store unsigned 16-bit integer value to a specified byte array, starting from a specified byte offset.
Declaration
public static void SetUInt16(this byte[] n, ulong aPos, ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | n | A byte array to store the value into. |
System.UInt64 | aPos | The offset (in bytes) from the start of the array, to where to store the value. |
System.UInt16 | value | The value to be stored. 16-bit unsigned integer. |
SetUInt32(Byte[], UInt64, UInt32)
Store unsigned 32-bit integer value to a specified byte array, starting from a specified byte offset.
Declaration
public static void SetUInt32(this byte[] n, ulong aPos, uint value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | n | A byte array to store the value into. |
System.UInt64 | aPos | The offset (in bytes) from the start of the array, to where to store the value. |
System.UInt32 | value | The value to be stored. 32-bit unsigned integer. |
SetUInt64(Byte[], UInt64, UInt64)
Store unsigned 64-bit integer value to a specified byte array, starting from a specified byte offset.
Declaration
public static void SetUInt64(this byte[] n, ulong aPos, ulong value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | n | A byte array to store the value into. |
System.UInt64 | aPos | The offset (in bytes) from the start of the array, to where to store the value. |
System.UInt64 | value | The value to be stored. 64-bit unsigned integer. |