Struct BitReader#
Defined in File Inflate.h
Struct Documentation#
-
struct BitReader#
Public Functions
-
explicit constexpr BitReader(std::span<const u8> data)#
Constructor. BitReader reads byte data bit by bit.
- Parameters:
data – Data to read in bytes.
-
constexpr ~BitReader() = default#
Destructor.
-
constexpr void EnsureBits9()#
Ensure the reader can at least read 9 bits in one or more ReadBits calls, safely even if not enough bits are available.
-
constexpr void EnsureBits17()#
Ensure the reader can at least read 17 bits in one or more ReadBits calls, safely even if not enough bits are available.
-
constexpr void EnsureBits25()#
Ensure the reader can at least read 25 bits in one or more ReadBits calls, safely even if not enough bits are available.
-
constexpr void EnsureBits32()#
Ensure the reader can at least read 32 bits in one or more ReadBits calls, safely even if not enough bits are available.
-
constexpr u32 ReadBits(usize nBits)#
Read n amount of bits.
Note
Must have enough bits available with EnsureBits.
- Parameters:
nBits – How many bits.
- Returns:
N bits read.
Public Members
-
bool Error = false#
-
explicit constexpr BitReader(std::span<const u8> data)#