• Create a new BitReader from source bytes.

    Parameters

    Returns BitReader

    const source = Uint8Array.of(0b1110_0001);
    const br = createBitReader(source, { mode: 'msb' });

    br.read32(3); // 0b111
    br.read32(1); // 0b0
    br.read32(3); // 0b000
    br.read32(1); // 0b1
    const source = Uint8Array.of(0b1110_0001);
    const r = createBitReader(source, { mode: 'lsb' });

    br.read32(3); // 0b001
    br.read32(1); // 0b0
    br.read32(3); // 0b110
    br.read32(1); // 0b1