aether::netcode::transcode::bit_stream Struct Reference

Wraps an array of bytes and provides an interface for reading arbitrary number of bits from the array. More...

#include <transcode.hh>

Public Member Functions

 bit_stream (const std::vector< uint8_t > &v, size_t total_bits, size_t offset_=0)
 Construct a bit stream from an array of bytes. More...
 
size_t get_bits (uint8_t *output, size_t nbits)
 same as get_bits(vector, size_t), but assuming the buffer is already allocated More...
 
size_t get_bits (std::vector< uint8_t > &output, size_t nbits)
 

Detailed Description

Wraps an array of bytes and provides an interface for reading arbitrary number of bits from the array.

Constructor & Destructor Documentation

aether::netcode::transcode::bit_stream::bit_stream ( const std::vector< uint8_t > &  v,
size_t  total_bits,
size_t  offset_ = 0 
)
inline

Construct a bit stream from an array of bytes.

Assuming there are padding_bits_ trailing padding bits in v

Member Function Documentation

size_t aether::netcode::transcode::bit_stream::get_bits ( uint8_t *  output,
size_t  nbits 
)
inline

same as get_bits(vector, size_t), but assuming the buffer is already allocated

size_t aether::netcode::transcode::bit_stream::get_bits ( std::vector< uint8_t > &  output,
size_t  nbits 
)
inline