Class DeflaterEngine
Low level compression engine for deflate algorithm which uses a 32K sliding window with secondary compression from Huffman/Shannon-Fano codes.
Inheritance
Inherited Members
Namespace: ICSharpCode.SharpZipLib.Zip.Compression
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class DeflaterEngine
Constructors
| Improve this Doc View SourceDeflaterEngine(DeflaterPending)
Construct instance with pending buffer Adler calculation will be performed
Declaration
public DeflaterEngine(DeflaterPending pending)
Parameters
Type | Name | Description |
---|---|---|
DeflaterPending | pending | Pending buffer to use |
DeflaterEngine(DeflaterPending, Boolean)
Construct instance with pending buffer
Declaration
public DeflaterEngine(DeflaterPending pending, bool noAdlerCalculation)
Parameters
Type | Name | Description |
---|---|---|
DeflaterPending | pending | Pending buffer to use |
System.Boolean | noAdlerCalculation | If no adler calculation should be performed |
Properties
| Improve this Doc View SourceAdler
Get current value of Adler checksum
Declaration
public int Adler { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Strategy
Get/set the deflate strategy
Declaration
public DeflateStrategy Strategy { get; set; }
Property Value
Type | Description |
---|---|
DeflateStrategy |
TotalIn
Total data processed
Declaration
public long TotalIn { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
| Improve this Doc View SourceDeflate(Boolean, Boolean)
Deflate drives actual compression of data
Declaration
public bool Deflate(bool flush, bool finish)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | flush | True to flush input buffers |
System.Boolean | finish | Finish deflation with the current input. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if progress has been made. |
FillWindow()
Fill the window
Declaration
public void FillWindow()
NeedsInput()
Determines if more input is needed.
Declaration
public bool NeedsInput()
Returns
Type | Description |
---|---|
System.Boolean | Return true if input is needed via SetInput |
Reset()
Reset internal state
Declaration
public void Reset()
ResetAdler()
Reset Adler checksum
Declaration
public void ResetAdler()
SetDictionary(Byte[], Int32, Int32)
Set compression dictionary
Declaration
public void SetDictionary(byte[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer containing the dictionary data |
System.Int32 | offset | The offset in the buffer for the first byte of data |
System.Int32 | length | The length of the dictionary data. |
SetInput(Byte[], Int32, Int32)
Sets input data to be deflated. Should only be called when
NeedsInput()
returns true
Declaration
public void SetInput(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer containing input data. |
System.Int32 | offset | The offset of the first byte of data. |
System.Int32 | count | The number of bytes of data to use as input. |
SetLevel(Int32)
Set the deflate level (0-9)
Declaration
public void SetLevel(int level)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | level | The value to set the level to. |