Class ByteExtensions
IO-related extension methods for
Inheritance
System.Object
ByteExtensions
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class ByteExtensions : object
Methods
| Improve this Doc View SourceGetBytes(Byte)
Returns the current 8-bit unsigned integer value as an array of bytes.
Declaration
public static byte[] GetBytes(this byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The number to convert. |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 1. |
TryWriteBytes(Byte, Span<Byte>)
Converts a
Declaration
public static bool TryWriteBytes(this byte value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The |
Span<System.Byte> | destination | When this method returns, the bytes representing the converted |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion was successful; otherwise, false. |