ddn.compressor.deflate_raw
ddn.compressor.deflate_raw
CompressionProvider for raw DEFLATE compression format (RFC 1951). This implements DEFLATE without any container/wrapper (no zlib or gzip headers).
Uses the pure D zlib implementation (ddn.compressor.zlib) with negative windowBits to produce raw DEFLATE streams.
Copyright
BSD-3-Clause
Module Initializers 1
shared static this
()Types 2
classDeflateRawCompressor : Compressor
Raw DEFLATE compressor using ddn.compressor.zlib with negative windowBits. Produces raw DEFLATE streams without zlib/gzip headers (RFC 1951).
Fields
private CompressionOptions _optsprivate z_stream _zsprivate OutputSink _sinkprivate ubyte[] _inputprivate ubyte[] _outputprivate int _windowBitsprivate ulong _bytesInprivate ulong _bytesOutprivate bool _dictSetprivate bool _finishedMethods
void setOutputSink(OutputSink sink)Set the output sink delegate that will receive produced compressed chunks.void setProgressCallback(ProgressCallback callback)Set an optional progress callback.void write(const(ubyte)[] data)Write uncompressed data to the compressor.void finish()Finish the stream and finalize compression.void reset()Reset the compressor to initial state.bool setDictionary(const(ubyte)[] dict)Set compression dictionary for better compression ratios.bool isFinished() @property constReturns true if finish() has been called and the stream is closed for further writes.private
void compressInternal(int flush)Constructors
this(CompressionOptions opts)Create a raw DEFLATE compressor with provided options.Destructors
~thisEnsure zlib stream is ended.Raw DEFLATE decompressor using ddn.compressor.zlib with negative windowBits. Decompresses raw DEFLATE streams without zlib/gzip headers (RFC 1951).
Fields
private DecompressionOptions _optsprivate z_stream _zsprivate OutputSink _sinkprivate ubyte[] _inputprivate ubyte[] _outputprivate int _windowBitsprivate ulong _bytesInprivate ulong _bytesOutprivate bool _dictSetprivate bool _sawStreamEndprivate bool _finishedMethods
void setOutputSink(OutputSink sink)Set the output sink delegate that will receive produced decompressed chunks.void setProgressCallback(ProgressCallback callback)Set an optional progress callback.void write(const(ubyte)[] data)Write compressed data to the decompressor.void finish()Finish decompression and finalize.void reset()Reset the decompressor to initial state.bool setDictionary(const(ubyte)[] dict)Set decompression dictionary for raw DEFLATE streams.bool isFinished() @property constReturns true if finish() has been called and the stream is closed for further writes.private
void decompressInternal(int flush)Constructors
this(DecompressionOptions opts)Create a raw DEFLATE decompressor with provided options.Destructors
Functions 5
fn
Compressor makeDeflateRawCompressor(CompressionOptions opts)Factory function that constructs a raw DEFLATE compressor.fn
Decompressor makeDeflateRawDecompressor(DecompressionOptions opts)Factory function that constructs a raw DEFLATE decompressor.