An encoder supporting Inflate/Deflate compression. More...
Public Member Functions | |
DeflateEncoder () noexcept | |
DeflateEncoder (BitStream data) noexcept | |
DeflateEncoder (BufferView<> data) noexcept | |
void | setDataStream (BitStream data) |
void | setTransientOutput (BufferView<> output) |
BufferView | decode () |
BufferView | decode (BufferView<> output) |
bool | isDecodingDone () const |
An encoder supporting Inflate/Deflate compression.
Note that currently, only decompression of pure raw streams (no gzip header) is supported.
Something to notice is that unlike other encoders offering free functions, this encoder needs to be instantiated as it needs to keep track of its status.
|
noexcept |
Default constructor.
|
noexcept |
Bitstream constructor.
data | The bitstream that should be used as input. |
|
noexcept |
data | The buffer that should be used as input. |
void nkMemory::DeflateEncoder::setDataStream | ( | BitStream | data | ) |
Sets the data stream to use as input.
data | The bit stream to use. |
void nkMemory::DeflateEncoder::setTransientOutput | ( | BufferView<> | output | ) |
Sets an output to populate through multiple decode(void) calls. The data will get appended each time a call is made, provided space is available.
output | The output to use. |
BufferView nkMemory::DeflateEncoder::decode | ( | ) |
Decodes the input stream, into the transient output registered.
BufferView nkMemory::DeflateEncoder::decode | ( | BufferView<> | output | ) |
Decodes the input stream, into the output buffer given as argument.
output | The output buffer to input to. |
bool nkMemory::DeflateEncoder::isDecodingDone | ( | ) | const |