Rizin
unix-like reverse engineering framework and cli tools
|
Implements a data compressor, using the deflate algorithm in the ZLib dll More...
Public Member Functions | |
Deflater (CompressLevel level) | |
Constructs an new instance of the Deflater More... | |
override void | Add (byte[] data, int offset, int count) |
Adds more data to the codec to be processed. More... | |
override void | Finish () |
Finishes up any pending data that needs to be processed and handled. More... | |
Public Member Functions inherited from DotZLib.CodecBase | |
CodecBase () | |
Initializes a new instance of the CodeBase class. More... | |
void | Add (byte[] data) |
Adds more data to the codec to be processed. More... | |
void | Dispose () |
Releases any unmanaged resources and calls the CleanUp() method of the derived class More... | |
Protected Member Functions | |
override void | CleanUp () |
Closes the internal zlib deflate stream More... | |
Protected Member Functions inherited from DotZLib.CodecBase | |
void | OnDataAvailable () |
Fires the DataAvailable event More... | |
void | copyInput (byte[] data, int startIndex, int count) |
Copies a number of bytes to the internal codec buffer - ready for proccesing More... | |
void | resetOutput () |
Resets the internal output buffers to a known state - ready for processing More... | |
void | setChecksum (uint newSum) |
Updates the running checksum property More... | |
Private Member Functions | |
static int | deflateInit_ (ref ZStream sz, int level, string vs, int size) |
static int | deflate (ref ZStream sz, int flush) |
static int | deflateReset (ref ZStream sz) |
static int | deflateEnd (ref ZStream sz) |
Additional Inherited Members | |
Protected Attributes inherited from DotZLib.CodecBase | |
bool | _isDisposed = false |
True if the object instance has been disposed, false otherwise More... | |
Static Protected Attributes inherited from DotZLib.CodecBase | |
const int | kBufferSize = 16384 |
The size of the internal buffers More... | |
Package Attributes inherited from DotZLib.CodecBase | |
ZStream | _ztream = new ZStream() |
Instance of the internal zlib buffer structure that is passed to all functions in the zlib dll More... | |
Properties inherited from DotZLib.CodecBase | |
uint | Checksum [get] |
Gets the checksum of the data that has been added so far More... | |
Properties inherited from DotZLib.Codec | |
uint | Checksum [get] |
Gets the checksum of the data that has been added so far More... | |
Events inherited from DotZLib.CodecBase | |
DataAvailableHandler | DataAvailable |
Occurs when more processed data are available. More... | |
Events inherited from DotZLib.Codec | |
DataAvailableHandler | DataAvailable |
Occurs when more processed data are available. More... | |
Implements a data compressor, using the deflate algorithm in the ZLib dll
Definition at line 18 of file Deflater.cs.
|
inline |
Constructs an new instance of the Deflater
level | The compression level to use for this Deflater |
Definition at line 38 of file Deflater.cs.
References DotZLib.CodecBase._ztream, DotZLib.Deflater.deflateInit_(), level, DotZLib.CodecBase.resetOutput(), and DotZLib.Info.Version.
Adds more data to the codec to be processed.
data | Byte array containing the data to be added to the codec |
offset | The index of the first byte to add from data |
count | The number of bytes to add |
Adding data may, or may not, raise the DataAvailable
event
Implements DotZLib.CodecBase.
Definition at line 54 of file Deflater.cs.
References DotZLib.CodecBase._ztream, DotZLib.ZStream.adler, DotZLib.ZStream.avail_in, DotZLib.ZStream.avail_out, DotZLib.CodecBase.copyInput(), count, DotZLib.Deflater.deflate(), err, int, DotZLib.CodecBase.kBufferSize, DotZLib.CodecBase.OnDataAvailable(), DotZLib.CodecBase.setChecksum(), and DotZLib.ZStream.total_in.
|
inlineprotectedvirtual |
Closes the internal zlib deflate stream
Implements DotZLib.CodecBase.
Definition at line 103 of file Deflater.cs.
References DotZLib.CodecBase._ztream, and DotZLib.Deflater.deflateEnd().
Referenced by DotZLib.Deflater.Add(), and DotZLib.Deflater.Finish().
Referenced by DotZLib.Deflater.CleanUp().
Referenced by DotZLib.Deflater.Deflater().
Referenced by DotZLib.Deflater.Finish().
|
inlinevirtual |
Finishes up any pending data that needs to be processed and handled.
Implements DotZLib.CodecBase.
Definition at line 86 of file Deflater.cs.
References DotZLib.CodecBase._ztream, DotZLib.ZStream.adler, DotZLib.Deflater.deflate(), DotZLib.Deflater.deflateReset(), err, DotZLib.CodecBase.OnDataAvailable(), DotZLib.CodecBase.resetOutput(), and DotZLib.CodecBase.setChecksum().