|
Fingerprint_Card
|
Low level compression engine for deflate algorithm which uses a 32K sliding window with secondary compression from Huffman/Shannon-Fano codes. More...


Public Member Functions | |
| DeflaterEngine (DeflaterPending pending) | |
| Construct instance with pending buffer. | |
| bool | Deflate (bool flush, bool finish) |
| Deflate drives actual compression of data. | |
| void | SetInput (byte[] buffer, int offset, int count) |
| Sets input data to be deflated. Should only be called when. | |
| bool | NeedsInput () |
| Determines if more input is needed. | |
| void | SetDictionary (byte[] buffer, int offset, int length) |
| Set compression dictionary. | |
| void | Reset () |
| Reset internal state. | |
| void | ResetAdler () |
| Reset Adler checksum. | |
| void | SetLevel (int level) |
| Set the deflate level (0-9) | |
| void | FillWindow () |
| Fill the window. | |
Properties | |
| int | Adler [get] |
| Get current value of Adler checksum. | |
| long | TotalIn [get] |
| Total data processed. | |
| DeflateStrategy | Strategy [get, set] |
| Get/set the deflate strategy | |
Private Member Functions | |
| void | UpdateHash () |
| int | InsertString () |
| Inserts the current string in the head hash and returns the previous value for this hash. | |
| void | SlideWindow () |
| bool | FindLongestMatch (int curMatch) |
| Find the best (longest) string in the window matching the string starting at strstart. | |
| bool | DeflateStored (bool flush, bool finish) |
| bool | DeflateFast (bool flush, bool finish) |
| bool | DeflateSlow (bool flush, bool finish) |
Private Attributes | |
| int | ins_h |
| short[] | head |
| Hashtable, hashing three characters to an index for window, so that window[index]..window[index+2] have this hash code. Note that the array should really be unsigned short, so you need to and the values with 0xffff. | |
| short[] | prev |
| int | matchStart |
| int | matchLen |
| bool | prevAvailable |
| int | blockStart |
| int | strstart |
| Points to the current character in the window. | |
| int | lookahead |
| lookahead is the number of characters starting at strstart in window that are valid. So window[strstart] until window[strstart+lookahead-1] are valid characters. | |
| byte[] | window |
| This array contains the part of the uncompressed stream that is of relevance. The current character is indexed by strstart. | |
| DeflateStrategy | strategy |
| int | max_chain |
| int | max_lazy |
| int | niceLength |
| int | goodLength |
| int | compressionFunction |
| The current compression function. | |
| byte[] | inputBuf |
| The input data for compression. | |
| long | totalIn |
| The total bytes of input read. | |
| int | inputOff |
| The offset into inputBuf, where input data starts. | |
| int | inputEnd |
| The end offset of the input data. | |
| DeflaterPending | pending |
| DeflaterHuffman | huffman |
| Adler32 | adler |
| The adler checksum. | |
Static Private Attributes | |
| const int | TooFar = 4096 |
Additional Inherited Members | |
| Static Public Attributes inherited from ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants | |
| const bool | DEBUGGING = false |
| Set to true to enable debugging. | |
| const int | STORED_BLOCK = 0 |
| Written to Zip file to identify a stored block. | |
| const int | STATIC_TREES = 1 |
| Identifies static tree in Zip file. | |
| const int | DYN_TREES = 2 |
| Identifies dynamic tree in Zip file. | |
| const int | PRESET_DICT = 0x20 |
| Header flag indicating a preset dictionary for deflation. | |
| const int | DEFAULT_MEM_LEVEL = 8 |
| Sets internal buffer sizes for Huffman encoding. | |
| const int | MAX_MATCH = 258 |
| Internal compression engine constant. | |
| const int | MIN_MATCH = 3 |
| Internal compression engine constant. | |
| const int | MAX_WBITS = 15 |
| Internal compression engine constant. | |
| const int | WSIZE = 1 << MAX_WBITS |
| Internal compression engine constant. | |
| const int | WMASK = WSIZE - 1 |
| Internal compression engine constant. | |
| const int | HASH_BITS = DEFAULT_MEM_LEVEL + 7 |
| Internal compression engine constant. | |
| const int | HASH_SIZE = 1 << HASH_BITS |
| Internal compression engine constant. | |
| const int | HASH_MASK = HASH_SIZE - 1 |
| Internal compression engine constant. | |
| const int | HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH |
| Internal compression engine constant. | |
| const int | MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1 |
| Internal compression engine constant. | |
| const int | MAX_DIST = WSIZE - MIN_LOOKAHEAD |
| Internal compression engine constant. | |
| const int | PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8) |
| Internal compression engine constant. | |
| static int | MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5) |
| Internal compression engine constant. | |
| const int | DEFLATE_STORED = 0 |
| Internal compression engine constant. | |
| const int | DEFLATE_FAST = 1 |
| Internal compression engine constant. | |
| const int | DEFLATE_SLOW = 2 |
| Internal compression engine constant. | |
| static int[] | GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 } |
| Internal compression engine constant. | |
| static int[] | MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 } |
| Internal compression engine constant. | |
| static int[] | NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 } |
| Internal compression engine constant. | |
| static int[] | MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 } |
| Internal compression engine constant. | |
| static int[] | COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 } |
| Internal compression engine constant. | |
Low level compression engine for deflate algorithm which uses a 32K sliding window with secondary compression from Huffman/Shannon-Fano codes.
| ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.DeflaterEngine | ( | DeflaterPending | pending | ) |
Construct instance with pending buffer.
| pending | Pending buffer to use |
>
| bool ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Deflate | ( | bool | flush, |
| bool | finish ) |
Deflate drives actual compression of data.
| flush | True to flush input buffers |
| finish | Finish deflation with the current input. |

|
private |


|
private |


|
private |

| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.FillWindow | ( | ) |
Fill the window.


|
private |
Find the best (longest) string in the window matching the string starting at strstart.
Preconditions:
| curMatch |

|
private |
Inserts the current string in the head hash and returns the previous value for this hash.

| bool ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.NeedsInput | ( | ) |
| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Reset | ( | ) |
Reset internal state.
| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.ResetAdler | ( | ) |
Reset Adler checksum.
| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetDictionary | ( | byte[] | buffer, |
| int | offset, | ||
| int | length ) |
Set compression dictionary.
| buffer | The buffer containing the dictionary data |
| offset | The offset in the buffer for the first byte of data |
| length | The length of the dictionary data. |

| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetInput | ( | byte[] | buffer, |
| int | offset, | ||
| int | count ) |
Sets input data to be deflated. Should only be called when.
returns true
| buffer | The buffer containing input data. |
| offset | The offset of the first byte of data. |
| count | The number of bytes of data to use as input. |
| void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetLevel | ( | int | level | ) |
Set the deflate level (0-9)
| level | The value to set the level to. |

|
private |

|
private |

|
private |
The adler checksum.
|
private |
|
private |
The current compression function.
|
private |
|
private |
Hashtable, hashing three characters to an index for window, so that window[index]..window[index+2] have this hash code.
Note that the array should really be unsigned short, so you need to and the values with 0xffff.
|
private |
|
private |
The input data for compression.
|
private |
The end offset of the input data.
|
private |
The offset into inputBuf, where input data starts.
|
private |
|
private |
lookahead is the number of characters starting at strstart in window that are valid. So window[strstart] until window[strstart+lookahead-1] are valid characters.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
points to the previous index that has the same hash code as the string starting at index. This way entries with the same hash code are in a linked list. Note that the array should really be unsigned short, so you need to and the values with 0xffff.
|
private |
|
private |
|
private |
Points to the current character in the window.
|
staticprivate |
|
private |
The total bytes of input read.
|
private |
This array contains the part of the uncompressed stream that is of relevance. The current character is indexed by strstart.
|
get |
Get current value of Adler checksum.
|
getset |
Get/set the deflate strategy
|
get |
Total data processed.