Deals with the loading and saving of blocks for coding. More...
#include <BlockBuffer.h>
Public Member Functions | |
BlockBuffer (int bufferSize) | |
Create the buffer of size bufferSize. | |
char * | bufferPtr (void) |
Return the pointer to the buffer begin used. | |
long | bufferSize (void) |
Return the size of the current buffer. | |
bool | bufferFull (void) |
True if we have scanned all of the buffer. | |
bool | bufferOverflow (void) |
True if we have scanned past the end of the buffer. | |
void | padBuffer (void) |
Fill the remainder of the buffer with zeros. | |
void | initialise (void) |
Set buffer scanner to the beginning. | |
void | truncateToNextBlock (int blockSize) |
Reduce the buffer size to a integral block size. | |
void | encodeInt (int element) |
Insert an integer at the current bit position. | |
int | decodeInt (void) |
Read interger at the current bit position. | |
long | bufferByteAlign (int blockBytes) |
Return the number of bytes + blockBytes used. | |
virtual void | flushBuffer (void)=0 |
Reset the buffer. | |
Protected Attributes | |
const int | _bufferSize |
The buffer size. | |
char * | _buffer |
The buffer pointer. | |
char * | _bufferPosition |
The current buffer position. | |
char * | _endBuffer |
The end of the buffer. |
Deals with the loading and saving of blocks for coding.
This class controls the contents of the buffer used when encoding or decoding data to and from files. The blockBuffer provides the functions to control the contents of the buffer that is used during compression.