FunctionAppends another binary buffer to the binary buffer append
a binary buffer
the updated binary buffer
FunctionAppends bytes from a number array to the binary buffer appendBytes
an array of numbers representing bytes
the number of used bits to append
the updated binary buffer
FunctionAppends a hexadecimal string to the binary buffer appendHex
a hexadecimal string
the number of used bits to append
the updated binary buffer
FunctionAppends a Uint8Array to the binary buffer appendU8a
an array of 8-bit unsigned integers
the number of used bits to append
the updated binary buffer
FunctionShortens the binary buffer to the length of the specified bits crop
the number of used bits, or, if negative, the number of bits to remove
the updated binary buffer
Extracts the specified bits from the binary buffer
the first bit to extract (inclusive)
the final bit of the extraction (exclusive), negative means until end of buffer
a new binary buffer with the extracted bits
Extracts the specified bits from the binary buffer to a hexadecimal string
the first bit to extract (inclusive)
the final bit of the extraction (exclusive), negative means until end of buffer
a hexadecimal string with the extracted data
FunctionExtracts the specified bits from the binary buffer to a Uint8Array extractU8a
the first bit to extract (inclusive)
the final bit of the extraction (exclusive), negative means until end of buffer
an array of 8-bit unsigned integers with the extracted data
FunctionInserts bytes from a number array at the start of the binary buffer insertBytes
an array of numbers representing bytes
the number of used bits to insert
the updated binary buffer
FunctionInserts a hexadecimal string at the start of the binary buffer insertHex
a hexadecimal string
the number of used bits to insert
the updated binary buffer
FunctionInserts a Uint8Array at the start of the binary buffer insertU8a
an array of 8-bit unsigned integers
the number of used bits to insert
the updated binary buffer
FunctionShifts bits in the buffer to the left, shrinking the buffer shiftLeft
the number of bits to shift to the left
the shifted binary buffer
FunctionShifts bits in the buffer to the right, enlarging the buffer shiftRight
the number of bits to shift to the right
the shifted binary buffer
FunctionGives the value of the binary buffer as a hexadecimal string toHex
a hexadecimal string
FunctionGives the value of the binary buffer as a Uint8Array toU8a
an array of 8-bit unsigned integers
StaticemptyStaticfromFunctionCreates a binary buffer from another binary buffer from
a binary buffer
a new binary buffer
StaticfromFunctionCreates a binary buffer from bytes in a number array fromBytes
an array of numbers representing bytes
the number of used bits
a new binary buffer
StaticfromFunctionCreates a binary buffer from a hexadecimal string fromHex
a hexadecimal string
the number of used bits
a new binary buffer
StaticfromFunctionCreates a binary buffer from a Uint8Array fromU8a
an array of 8-bit unsigned integers
the number of used bits
a new binary buffer
A class representing a binary buffer BinaryBuffer
Remarks
Objects of this class represent a binary encoded piece of data, e.g. a Whiteflag message, that can be manipulated at bit level. This class provides the basic (not Whiteflag-specific) functionality for other Whiteflag packages to encode and decode binary Whiteflag messages.