Class PackedBitReader

Class Documentation

class PackedBitReader

reads the bits of a sequence of bytes in the order of a PackedBitWriter, and zeros past its end

Public Functions

inline explicit PackedBitReader(std::span<const std::uint8_t> b)

the reader of the bytes b, which must outlive it

bool get(void)

the next bit, 0 past the end

std::uint64_t get(int k)

the value of the next k bits, the first the most significant

Pre:

0 <= k <= 64

inline std::size_t position(void) const

the number of bits read, past the end too

inline std::size_t size(void) const

the number of bits of the bytes