Class DecimalExtensions
IO-related extension methods for
Inheritance
System.Object
DecimalExtensions
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class DecimalExtensions : object
Methods
| Improve this Doc View SourceGetBigEndianBytes(Decimal)
Converts the current decimal number into an array of bytes, as little endian.
Declaration
public static byte[] GetBigEndianBytes(this decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 16. |
GetLittleEndianBytes(Decimal)
Converts the current decimal number into an array of bytes, as little endian.
Declaration
public static byte[] GetLittleEndianBytes(this decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 16. |
TryWriteBigEndianBytes(Decimal, Span<Byte>)
Converts the current decimal number into a span of bytes, as big endian.
Declaration
public static bool TryWriteBigEndianBytes(this decimal value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | 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(Decimal, Span<Byte>)
Converts the current decimal number into a span of bytes, as little endian.
Declaration
public static bool TryWriteLittleEndianBytes(this decimal value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | 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. |