byteme
C++ wrappers for buffered inputs
|
Read and decompress bytes from a Zlib-compressed buffer. More...
#include <ZlibBufferReader.hpp>
Public Member Functions | |
ZlibBufferReader (const unsigned char *buffer, size_t length, int mode=3, size_t buffer_size=65536) | |
bool | load () |
const unsigned char * | buffer () const |
size_t | available () const |
Public Member Functions inherited from byteme::Reader |
Read and decompress bytes from a Zlib-compressed buffer.
This is basically a wrapper around Zlib's inflate method, with correct closing and error checking.
|
inline |
buffer | Pointer to an array containing the compressed data. |
length | Length of the buffer array. |
mode | Compression of the stream - DEFLATE (0), Zlib (1) or Gzip (2). Default of 3 will auto-detect between Zlib and Gzip based on the headers. |
buffer_size | Size of the buffer to use for reading. |
|
inlinevirtual |
This method should only be called after load()
has been called and returns true
. The return value is generally expected to be positive; however, it is possible to return a zero. Note that zero values should not be interpreted as the end of the source, which is strictly only defined by load()
returning false
.
buffer()
. Implements byteme::Reader.
|
inlinevirtual |
This method should only be called after load()
has been called and returns true
.
available()
. Implements byteme::Reader.
|
inlinevirtual |
Read the next chunk of bytes from the input source. To read the entire source, this function should be called repeatedly until false
is returned.
false
, it can be assumed that the end of the source was reached. Implements byteme::Reader.