Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
Stream buffer that performs compression. More...
#include <compression.hh>
Public Member Functions | |
CompressBuffer (ostream &s, int4 level) | |
Constructor. | |
~CompressBuffer (void) | |
Destructor. | |
Protected Member Functions | |
void | flushInput (bool lastBuffer) |
Compress the current set of bytes in the input buffer. | |
virtual int | overflow (int c) |
Pass the filled input buffer to the compressor. | |
virtual int | sync (void) |
Pass remaining bytes in the input buffer to the compressor. | |
Private Attributes | |
ostream & | outStream |
The backing stream receiving compressed bytes. | |
uint1 * | inBuffer |
The input buffer. | |
uint1 * | outBuffer |
The output buffer. | |
Compress | compressor |
Compressor state. | |
Static Private Attributes | |
static const int4 | IN_BUFFER_SIZE = 4096 |
Number of bytes in the input buffer. | |
static const int4 | OUT_BUFFER_SIZE = 4096 |
Number of bytes in the output buffer. | |
Stream buffer that performs compression.
Provides an ostream filter that compresses the stream using the deflate algorithm. The stream buffer is provided a backing stream that is the ultimate destination of the compressed bytes. A front-end stream is initialized with this stream buffer. After writing the full sequence of bytes to compressed to the front-end stream, make sure to call the stream's flush() method to emit the final compressed bytes to the backing stream.
ghidra::CompressBuffer::CompressBuffer | ( | ostream & | s, |
int4 | level | ||
) |
s | is the backing output stream |
level | is the level of compression |
References IN_BUFFER_SIZE, inBuffer, OUT_BUFFER_SIZE, and outBuffer.
|
protected |
Compress the current set of bytes in the input buffer.
The compressor is called repeatedly and its output is written to the backing stream until the compressor can no longer fill the output buffer.
lastBuffer | is true if this is the final set of bytes to add to the compressed stream |
References compressor, ghidra::Compress::deflate(), ghidra::Compress::input(), OUT_BUFFER_SIZE, outBuffer, and outStream.
Referenced by overflow(), and sync().
|
protectedvirtual |
Pass the filled input buffer to the compressor.
c | is the final character filling the buffer |
References flushInput().
|
protectedvirtual |
Pass remaining bytes in the input buffer to the compressor.
References flushInput().