Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
Wrapper for the deflate algorithm. More...
#include <compression.hh>
Public Member Functions | |
Compress (int4 level) | |
Initialize the deflate algorithm state. | |
~Compress (void) | |
Free algorithm state resources. | |
void | input (uint1 *buffer, int4 sz) |
Provide the next sequence of bytes to be compressed. | |
int4 | deflate (uint1 *buffer, int4 sz, bool finish) |
Deflate as much as possible into given buffer. | |
Private Attributes | |
z_stream | compStream |
The zlib deflate algorithm state. | |
Wrapper for the deflate algorithm.
Initialize/free algorithm resources. Provide successive arrays of bytes to compress via the input() method. Compute successive arrays of compressed bytes via the deflate() method.
ghidra::Compress::Compress | ( | int4 | level | ) |
Initialize the deflate algorithm state.
The compression level ranges from 1-9 from faster/least compression to slower/most compression. Use a level of 0 for no compression and -1 for the default compression level.
level | is the compression level |
References compStream.
int4 ghidra::Compress::deflate | ( | uint1 * | buffer, |
int4 | sz, | ||
bool | finish | ||
) |
Deflate as much as possible into given buffer.
Return the number of bytes of output space still available. Output may be limited by the amount of space in the output buffer or the amount of data available in the current input buffer.
buffer | is where compressed bytes are stored |
sz | is the size, in bytes, of the buffer |
finish | is set to true if this is the final buffer to add to the stream |
References compStream, and deflate().
Referenced by deflate(), and ghidra::CompressBuffer::flushInput().
|
inline |
Provide the next sequence of bytes to be compressed.
buffer | is a pointer to the bytes to compress |
sz | is the number of bytes |
References compStream.
Referenced by ghidra::CompressBuffer::flushInput().