RPNX::Compress
Self-contained C++20 compression and ZIP library
 
Loading...
Searching...
No Matches
rpnx::compression::zstandard_codec::reverse_bit_reader Class Reference

Read a Zstandard entropy bitstream from its end toward its beginning. More...

#include <zstandard.hpp>

Public Member Functions

 reverse_bit_reader (std::span< std::byte const > input)
 Constructs a reader and removes the mandatory final-bit marker.
 
std::uint32_t read_bits (std::uint8_t count)
 Consumes bits preceding the current reverse-stream position.
 
std::size_t remaining_bits () const noexcept
 Returns the number of useful bits not yet consumed.
 

Detailed Description

Read a Zstandard entropy bitstream from its end toward its beginning.

Definition at line 196 of file zstandard.hpp.

Constructor & Destructor Documentation

◆ reverse_bit_reader()

rpnx::compression::zstandard_codec::reverse_bit_reader::reverse_bit_reader ( std::span< std::byte const > input)
inlineexplicit

Constructs a reader and removes the mandatory final-bit marker.

Parameters
inputComplete reverse bitstream retained for this object's lifetime.

Definition at line 203 of file zstandard.hpp.

Member Function Documentation

◆ read_bits()

std::uint32_t rpnx::compression::zstandard_codec::reverse_bit_reader::read_bits ( std::uint8_t count)
inlinenodiscard

Consumes bits preceding the current reverse-stream position.

Parameters
countNumber of bits, at most 32.
Returns
Field value in least-significant-bit-first wire order.

Definition at line 226 of file zstandard.hpp.

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

Referenced by rpnx::compression::zstandard_codec::decode_fse_weights(), rpnx::compression::zstandard_codec::decode_huffman_stream(), and rpnx::compression::zstandard_codec::decompress_compressed_block().

◆ remaining_bits()

std::size_t rpnx::compression::zstandard_codec::reverse_bit_reader::remaining_bits ( ) const
inlinenodiscardnoexcept

Returns the number of useful bits not yet consumed.

Returns
Remaining bit count before the end marker.

Definition at line 248 of file zstandard.hpp.

Referenced by rpnx::compression::zstandard_codec::decode_fse_weights(), rpnx::compression::zstandard_codec::decode_huffman_stream(), and rpnx::compression::zstandard_codec::decompress_compressed_block().


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