Utility module for incrementally building a bitstring using iodata. It accumulates bits in a buffer and flushes complete bytes to an iolist, preserving performance while allowing non-byte-aligned final output.
Summary
Functions
Convert the accumulated bits to a binary. Any remaining bits fewer than a byte are appended at the end without padding.
Write size bits from value into the writer.
Write the given bits bitstring into the writer.
Types
@type t() :: %GorillaStream.Compression.Encoder.BitWriter{ acc: iodata(), bits: non_neg_integer(), buf: non_neg_integer() }
Functions
Convert the accumulated bits to a binary. Any remaining bits fewer than a byte are appended at the end without padding.
@spec write(t(), non_neg_integer(), non_neg_integer()) :: t()
Write size bits from value into the writer.
Write the given bits bitstring into the writer.