RPNX::Compress
Self-contained C++20 compression and ZIP library
 
Loading...
Searching...
No Matches
rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type > Class Template Reference

MSB-first bit reader backed by a single-pass byte reader. More...

#include <bzip2.hpp>

Public Member Functions

 iterator_bit_reader (byte_reader_type &input) noexcept
 Constructs a bit reader over a byte reader.
 
std::uint64_t read_bits (std::uint8_t count)
 Consumes a big-endian bit field containing at most 64 bits.
 
void align_to_byte () noexcept
 Discard padding through the next byte boundary.
 

Detailed Description

template<typename byte_reader_type>
class rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type >

MSB-first bit reader backed by a single-pass byte reader.

Template Parameters
byte_reader_typeSource reader providing read().

Definition at line 768 of file bzip2.hpp.

Constructor & Destructor Documentation

◆ iterator_bit_reader()

template<typename byte_reader_type>
rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type >::iterator_bit_reader ( byte_reader_type & input)
inlineexplicitnoexcept

Constructs a bit reader over a byte reader.

Parameters
inputBorrowed reader that must outlive this object.

Definition at line 775 of file bzip2.hpp.

Member Function Documentation

◆ align_to_byte()

template<typename byte_reader_type>
void rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type >::align_to_byte ( )
inlinenoexcept

Discard padding through the next byte boundary.

Definition at line 811 of file bzip2.hpp.

◆ read_bits()

template<typename byte_reader_type>
std::uint64_t rpnx::compression::bzip2_codec::iterator_bit_reader< byte_reader_type >::read_bits ( std::uint8_t count)
inlinenodiscard

Consumes a big-endian bit field containing at most 64 bits.

Parameters
countNumber of bits to consume.
Returns
Field value with the earliest bit as the most significant bit.
Exceptions
compression_errorIf the count exceeds 64 or input is truncated.

Definition at line 785 of file bzip2.hpp.

References rpnx::compression::bzip2, and rpnx::compression::invalid_data.


The documentation for this class was generated from the following file: