Functions
getBitArrayDecoder
getBitArrayDecoder<
TSize
>(size
,config?
):FixedSizeDecoder
<boolean
[],TSize
>
Returns a decoder that unpacks bits into an array of booleans.
This decoder converts a compact bit representation back into a list of boolean
values.
Each byte is expanded into 8 booleans.
The backward
config option determines whether the bits are read in MSB-first (false
)
or LSB-first (true
).
For more details, see getBitArrayCodec.
Type Parameters
Type Parameter | Description |
---|---|
TSize extends number | The number of bytes used to store the bit array. |
Parameters
Parameter | Type | Description |
---|---|---|
size | TSize | The number of bytes allocated for the bit array (must be sufficient for the expected boolean count). |
config? | boolean | BitArrayCodecConfig | Configuration options for decoding the bit array. |
Returns
FixedSizeDecoder
<boolean
[], TSize
>
A FixedSizeDecoder<boolean[], TSize>
for decoding bit arrays.
Example
Decoding a bit array.