C# Class Plupload.PngEncoder.DeflaterEngine

Low level compression engine for deflate algorithm which uses a 32K sliding window with secondary compression from Huffman/Shannon-Fano codes.
Inheritance: DeflaterConstants
Datei anzeigen Open project: akoch-ov/dipstart-development Class Usage Examples

Public Methods

Method Description
Deflate ( bool flush, bool finish ) : bool

Deflate drives actual compression of data

DeflaterEngine ( DeflaterPending pending ) : System

Construct instance with pending buffer

FillWindow ( ) : void

Fill the window

NeedsInput ( ) : bool

Determines if more input is needed.

Reset ( ) : void

Reset internal state

ResetAdler ( ) : void

Reset Adler checksum

SetDictionary ( byte buffer, int offset, int length ) : void

Set compression dictionary

SetInput ( byte buffer, int offset, int count ) : void

Sets input data to be deflated. Should only be called when NeedsInput() returns true

SetLevel ( int level ) : void

Set the deflate level (0-9)

Private Methods

Method Description
DeflateFast ( bool flush, bool finish ) : bool
DeflateSlow ( bool flush, bool finish ) : bool
DeflateStored ( bool flush, bool finish ) : bool
FindLongestMatch ( int curMatch ) : bool

Find the best (longest) string in the window matching the string starting at strstart. Preconditions: strstart + MAX_MATCH <= window.length.

InsertString ( ) : int

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

SlideWindow ( ) : void
UpdateHash ( ) : void

Method Details

Deflate() public method

Deflate drives actual compression of data
public Deflate ( bool flush, bool finish ) : bool
flush bool True to flush input buffers
finish bool Finish deflation with the current input.
return bool

DeflaterEngine() public method

Construct instance with pending buffer
public DeflaterEngine ( DeflaterPending pending ) : System
pending DeflaterPending /// Pending buffer to use ///
return System

FillWindow() public method

Fill the window
public FillWindow ( ) : void
return void

NeedsInput() public method

Determines if more input is needed.
public NeedsInput ( ) : bool
return bool

Reset() public method

Reset internal state
public Reset ( ) : void
return void

ResetAdler() public method

Reset Adler checksum
public ResetAdler ( ) : void
return void

SetDictionary() public method

Set compression dictionary
public SetDictionary ( byte buffer, int offset, int length ) : void
buffer byte The buffer containing the dictionary data
offset int The offset in the buffer for the first byte of data
length int The length of the dictionary data.
return void

SetInput() public method

Sets input data to be deflated. Should only be called when NeedsInput() returns true
public SetInput ( byte buffer, int offset, int count ) : void
buffer byte The buffer containing input data.
offset int The offset of the first byte of data.
count int The number of bytes of data to use as input.
return void

SetLevel() public method

Set the deflate level (0-9)
public SetLevel ( int level ) : void
level int The value to set the level to.
return void