Implementing streaming compression algorithms, one usually need a super-fast FIFO bit container class with the following functions:
AddBits(UINT n, UINT nBits); // Add lower nBits bits of n
GetBitCount(); // Get the number of bits currently stored
GetBits(BYTE* n, UINT nBits); // Extract n Bits, and remove them
The number of bits is bounded to a relatively small size (the 'packet' size or a bit more).
I'm looking for a small C++ class which implement this functionality.
Yes, I can write one (and know how to do it), but probably someone wrote it already...
Note: I don't want to add boost / whatever-big-lib to my project just for this.