ZLIB deflater.
More...
#include <base/compression/ZLibDeflater.h>
Inherits Object, and Deflater.
ZLIB deflater.
ZLIB deflater push stream.
- Version
- 1.0
◆ ZLibDeflater() [1/2]
ZLibDeflater::ZLibDeflater |
( |
| ) |
|
Initializes the deflater with the default compression level.
◆ ZLibDeflater() [2/2]
ZLibDeflater::ZLibDeflater |
( |
unsigned int |
compressionLevel | ) |
|
Initializes the deflater with the specified compression level.
- Parameters
-
compressionLevel | The compression level. |
◆ ~ZLibDeflater()
virtual ZLibDeflater::~ZLibDeflater |
( |
| ) |
|
|
virtualnoexcept |
◆ atEnd()
bool ZLibDeflater::atEnd |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Returns true if the end has been reached. This always returns false until pushEnd() has been invoked.
Implements Deflater.
◆ flush()
void ZLibDeflater::flush |
( |
| ) |
|
|
virtual |
Flushes the stream. Invoke pull() one or more times to read the compressed data. The stream has been flushed when pull() returns 0.
Implements Deflater.
◆ isSupported()
static bool ZLibDeflater::isSupported |
( |
| ) |
|
|
staticnoexcept |
Returns true if ZLib is supported by the runtime.
◆ pull()
MemorySize ZLibDeflater::pull |
( |
uint8 * |
buffer, |
|
|
MemorySize |
size |
|
) |
| |
|
virtual |
Pulls compressed bytes from the stream. EndOfFile is raised if atEnd() would return true. This method may return 0 in the normal deflation mode if the internal buffer is not full. Use flush() to force any buffered data through the pull() interface. Flush is completed when pull() returns 0.
- Parameters
-
buffer | The buffer to receive the compressed data. |
size | The size of the buffer. |
- Returns
- The number of bytes pulled.
Implements PullInterface.
◆ push()
MemorySize ZLibDeflater::push |
( |
const uint8 * |
buffer, |
|
|
MemorySize |
size |
|
) |
| |
|
virtual |
Pushes uncompressed data onto the stream. This method may return 0 if the internal buffer is full. EndOfFile is raised if the end has been reached. IOException is raised unless the deflater is in the normal compression mode.
- Parameters
-
buffer | The data to be pushed onto the stream. |
size | The size of the buffer. |
- Returns
- The number of bytes pushed.
Implements PushInterface.
◆ pushEnd()
void ZLibDeflater::pushEnd |
( |
| ) |
|
|
virtual |
This method should be invoked when all uncompressed data has been pushed onto the stream. Do not invoke flush(), push(), or pushEnd() hereafter.
Reimplemented from PushInterface.
◆ BUFFER_SIZE
const unsigned int ZLibDeflater::BUFFER_SIZE = 64 * 1024 |
|
static |
The size of the compression buffer.
◆ DEFAULT_COMPRESSION_LEVEL
const unsigned int ZLibDeflater::DEFAULT_COMPRESSION_LEVEL = 6 |
|
static |
The default compression level.