aether::netcode::transcode::bit_appender Struct Reference

Densely pack a stream of bits into a byte array. More...

#include <transcode.hh>

Public Member Functions

void push_bits (const uint8_t *input, const size_t nbits)
 Pack nbits bits from input into the output array. More...
 
size_t size_bits () const
 
 bit_appender (std::vector< uint8_t > &_output, const size_t _total_bits)
 Create an appender that appends into v, assuming there is already nbits written there. More...
 

Detailed Description

Densely pack a stream of bits into a byte array.

Constructor & Destructor Documentation

aether::netcode::transcode::bit_appender::bit_appender ( std::vector< uint8_t > &  _output,
const size_t  _total_bits 
)
inline

Create an appender that appends into v, assuming there is already nbits written there.

Member Function Documentation

void aether::netcode::transcode::bit_appender::push_bits ( const uint8_t *  input,
const size_t  nbits 
)
inline

Pack nbits bits from input into the output array.

Parameters
inputthe input bits
nbitsthe number of bits
size_t aether::netcode::transcode::bit_appender::size_bits ( ) const
inline
Returns
number of bits in the output array