CoreComponents 4.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
BitSink Class Reference

Bit-wise write to a ByteSink. More...

#include <cc/BitSink>

Public Member Functions

 BitSink (const Bytes &buffer)
 Create a new bit output sink.
 
void writeBit (bool bit)
 Write a single bit.
 
template<int n, class T >
void writeBits (T word)
 Write n bits of word, starting from the n-th more significiant bit to the least significiant bit of word.
 

Detailed Description

Bit-wise write to a ByteSink.

Exceptions
OutputExhaustion
Note
It is up to the user to write padding bits. Only full bytes will be written to the output.

Constructor & Destructor Documentation

◆ BitSink()

BitSink ( const Bytes buffer)

Create a new bit output sink.

Member Function Documentation

◆ writeBit()

void writeBit ( bool  bit)

Write a single bit.

◆ writeBits()

template<int n, class T >
void writeBits ( word)

Write n bits of word, starting from the n-th more significiant bit to the least significiant bit of word.