The advanced options for configuring the type of BitReader that is constructed.

interface BitReaderOptions {
    mode?: "msb" | "lsb";
    fast?: boolean;
}

Properties

Properties

mode?: "msb" | "lsb"

Select the bit-ordering mode for the bitstream: either most-significant bits first or least-significant bits first.

msb

fast?: boolean

Copy the source data into a uint32 aligned backing ArrayBuffer to facilitate slightly faster bitwise maths and OOB checks.

false.

In certain cases this can be faster, but its also needs to copy the source array buffer to avoid buffer overruns, making it less memory efficient. Generally, a normal BitReader is negligibly slower, generally safer, and doesn't incur the memory/copy penalty.