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