Class UInt32Extensions
IO-related extension methods for
Inheritance
System.Object
UInt32Extensions
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class UInt32Extensions : object
Methods
| Improve this Doc View SourceGetBigEndianBytes(UInt32)
Converts the current 32-bit unsigned integer into an array of bytes, as big endian.
Declaration
public static byte[] GetBigEndianBytes(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 8. |
GetLittleEndianBytes(UInt32)
Converts the current 32-bit unsigned integer into an array of bytes, as big endian.
Declaration
public static byte[] GetLittleEndianBytes(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 8. |
TryWriteBigEndianBytes(UInt32, Span<Byte>)
Writes the current 32-bit unsigned integer into a span of bytes, as big endian.
Declaration
public static bool TryWriteBigEndianBytes(this uint value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The |
Span<System.Byte> | destination | The span of bytes where the value is to be written, as big endian. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion was successful; otherwise, false. |
TryWriteLittleEndianBytes(UInt32, Span<Byte>)
Writes the current 32-bit unsigned integer into a span of bytes, as little endian.
Declaration
public static bool TryWriteLittleEndianBytes(this uint value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The |
Span<System.Byte> | destination | The span of bytes where the value is to be written, as little endian. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion was successful; otherwise, false. |