toByteArray
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.