Class DeflaterHuffman
This is the DeflaterHuffman class.
This class is not thread safe. This is inherent in the API, due to the split of Deflate and SetInput.
author of the original java version : Jochen Hoenicke
Inheritance
Inherited Members
Namespace: ICSharpCode.SharpZipLib.Zip.Compression
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class DeflaterHuffman
Constructors
| Improve this Doc View SourceDeflaterHuffman(DeflaterPending)
Construct instance with pending buffer
Declaration
public DeflaterHuffman(DeflaterPending pending)
Parameters
Type | Name | Description |
---|---|---|
DeflaterPending | pending | Pending buffer to use |
Fields
| Improve this Doc View Sourcepending
Pending buffer to use
Declaration
public DeflaterPending pending
Field Value
Type | Description |
---|---|
DeflaterPending |
Methods
| Improve this Doc View SourceBitReverse(Int32)
Reverse the bits of a 16 bit value.
Declaration
public static short BitReverse(int toReverse)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | toReverse | Value to reverse bits |
Returns
Type | Description |
---|---|
System.Int16 | Value with bits reversed |
CompressBlock()
Compress current buffer writing data to pending buffer
Declaration
public void CompressBlock()
FlushBlock(Byte[], Int32, Int32, Boolean)
Flush block to output with compression
Declaration
public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | stored | Data to flush |
System.Int32 | storedOffset | Index of first byte to flush |
System.Int32 | storedLength | Count of bytes to flush |
System.Boolean | lastBlock | True if this is the last block |
FlushStoredBlock(Byte[], Int32, Int32, Boolean)
Flush block to output with no compression
Declaration
public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | stored | Data to write |
System.Int32 | storedOffset | Index of first byte to write |
System.Int32 | storedLength | Count of bytes to write |
System.Boolean | lastBlock | True if this is the last block |
IsFull()
Get value indicating if internal buffer is full
Declaration
public bool IsFull()
Returns
Type | Description |
---|---|
System.Boolean | true if buffer is full |
Reset()
Reset internal state
Declaration
public void Reset()
SendAllTrees(Int32)
Write all trees to pending buffer
Declaration
public void SendAllTrees(int blTreeCodes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | blTreeCodes | The number/rank of treecodes to send. |
TallyDist(Int32, Int32)
Add distance code and length to literal and distance trees
Declaration
public bool TallyDist(int distance, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | distance | Distance code |
System.Int32 | length | Length |
Returns
Type | Description |
---|---|
System.Boolean | Value indicating if internal buffer is full |
TallyLit(Int32)
Add literal to buffer
Declaration
public bool TallyLit(int literal)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | literal | Literal value to add to buffer. |
Returns
Type | Description |
---|---|
System.Boolean | Value indicating internal buffer is full |