#include <ZBitStream.h>
Public Member Functions | |
bool | WriteBits (const ZStreamW &iStream, size_t iCountBits, uint32 iBits) |
Write the low iCountBits from iBits to iStream. | |
void | WriteBits (void *iDest, size_t iCountBits, uint32 iBits, size_t *oCountBytesWritten) |
Write the low iCountBits from iBits to iDest. | |
void | Finish (const ZStreamW &iStream) |
Flush the buffer by writing pending bits to iStream. | |
void | Finish (void *iDest, size_t *oCountBytesWritten) |
Flush the buffer by writing pending bits to iDest. |
Write the low iCountBits from iBits to iStream.
Bits are written one byte at a time, so are buffered by ZBitWriterBE until 8 are available. The bits in the stream are considered to be ordered from low to high within consecutive bytes. Passing 16 or 32 bits at a time in iBits will thus put the data onto the stream in little endian order.
void ZBitWriterBE::WriteBits | ( | void * | iDest, | |
size_t | iCountBits, | |||
uint32 | iBits, | |||
size_t * | oCountBytesWritten | |||
) |
Write the low iCountBits from iBits to iDest.
Bits are written one byte at a time, so are buffered by ZBitWriterBE until 8 are available. The number of bytes actually written is returned in oCountBytesWritten, and can of course be zero. The bits in memory are considered to be ordered from low to high within consecutive bytes. Passing 16 or 32 bits at a time in iBits will thus put the data into memory in little endian order.
void ZBitWriterBE::Finish | ( | void * | iDest, | |
size_t * | oCountBytesWritten | |||
) |
Flush the buffer by writing pending bits to iDest.
The number of bytes written is returned in oCountBytesWritten.