toByteArray
Converts a Long to a byte array using the given endianness.
The optional length parameter allows you to specify the actual length of the field, to convert 8-bit, 16-bit, 24-bit, 32-bit, 40-bit, 48-bit or 54-bit integers stored in a 'Long' to a byte array.
Parameters
The length of the field, in bytes, within the range of 1-Long.SIZE_BYTES with default value equal to Long.SIZE_BYTES bytes.
The byte order, default is ByteOrder.BIG_ENDIAN.
Throws
If the length is not within the range of 1 to Long.SIZE_BYTES.
Converts a ULong to a byte array using the given endianness.
The optional length parameter allows you to specify the actual length of the field, to convert 8-bit, 16-bit or 24-bit integers stored in an UInt to a byte array.
Parameters
The length of the field, in bytes, within the range of 1-ULong.SIZE_BYTES with default value equal to ULong.SIZE_BYTES bytes.
The byte order, default is ByteOrder.BIG_ENDIAN.
Throws
If the length is not within the range of 1 to ULong.SIZE_BYTES.
Converts an Int to a byte array using the given endianness.
The optional length parameter allows you to specify the actual length of the field, to convert 8-bit, 16-bit or 24-bit integers stored in an Int to a byte array.
Parameters
The length of the field, in bytes, within the range of 1-Int.SIZE_BYTES with default value equal to Int.SIZE_BYTES bytes.
The byte order, default is ByteOrder.BIG_ENDIAN.
Throws
If the length is not within the range of 1 to Int.SIZE_BYTES.
Converts an UInt to a byte array using the given endianness.
The optional length parameter allows you to specify the actual length of the field, to convert 8-bit, 16-bit or 24-bit integers stored in an UInt to a byte array.
Parameters
The length of the field, in bytes, within the range of 1-UInt.SIZE_BYTES with default value equal to UInt.SIZE_BYTES bytes.
The byte order, default is ByteOrder.BIG_ENDIAN.
Throws
If the length is not within the range of 1 to UInt.SIZE_BYTES.
Converts a Short to a byte array using the given endianness.
Parameters
The byte order, default is ByteOrder.BIG_ENDIAN.
Converts a UShort to a byte array using the given endianness.
Parameters
The byte order, default is ByteOrder.BIG_ENDIAN.
Converts a Byte to a byte array.
Converts a UByte to a byte array.
Converts a byte array to a hex string.
Parameters
The format of the hex string.
Converts a 128-bit Uuid to a byte array.
Parameters
The byte order, default is ByteOrder.BIG_ENDIAN.