Skip to main content

Module bitstream

Module bitstream 

Source
Expand description

Bit-aligned reader and writer.

Per spec §4.6: bits are packed MSB-first into bytes. The first bit of the payload occupies the most-significant bit of the first byte. The final byte is zero-padded if needed.

Structs§

BitReader
MSB-first bit unpacker over a borrowed byte slice.
BitWriter
MSB-first bit packer.

Functions§

re_emit_bits
Reads exactly bit_len MSB-first bits from src_bytes and appends them to dst. Bits are sourced as if src_bytes were the output of a BitWriter finalized with into_bytes() (so the trailing partial byte is in the high bits of the last source byte). The destination is extended in-place — no padding inserted.