Deflater Members

SharpZip Compression Library

SharpZip Compression Library

Deflater Members

Deflater overview

Public Static Fields

BEST_COMPRESSION The best and slowest compression level. This tries to find very long and distant string repetitions.
BEST_SPEED The worst but fastest compression level.
DEFAULT_COMPRESSION The default compression level.
DEFLATED The compression method. This is the only method supported so far. There is no need to use this constant at all.
NO_COMPRESSION This level won't compress at all but output uncompressed blocks.

Public Instance Constructors

Deflater Overloaded. Initializes a new instance of the Deflater class.

Public Instance Properties

Adler Gets the current adler checksum of the data that was processed so far.
IsFinished Returns true if the stream was finished and no more output bytes are available.
IsNeedingInput Returns true, if the input buffer is empty. You should then call setInput(). NOTE: This method can also return true when the stream was finished.
TotalIn Gets the number of input bytes processed so far.
TotalOut Gets the number of output bytes so far.

Public Instance Methods

DeflateOverloaded. Deflates the current input block with to the given array.
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
Finish Finishes the deflater with the current input block. It is an error to give more input after this method was called. This method must be called to force all bytes to be flushed.
Flush Flushes the current input block. Further calls to deflate() will produce enough output to inflate everything in the current input block. This is not part of Sun's JDK so I have made it package private. It is used by DeflaterOutputStream to implement flush().
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLevel Get current compression level
GetType (inherited from Object) Gets the Type of the current instance.
Reset Resets the deflater. The deflater acts afterwards as if it was just created with the same compression level and strategy as it had before.
SetDictionaryOverloaded. Sets the dictionary which should be used in the deflate process. This call is equivalent to
setDictionary(dict, 0, dict.Length)
.
SetInputOverloaded. Sets the data which should be compressed next. This should be only called when needsInput indicates that more input is needed. If you call setInput when needsInput() returns false, the previous input that is still pending will be thrown away. The given byte array should not be changed, before needsInput() returns true again. This call is equivalent to
setInput(input, 0, input.length)
.
SetLevel Sets the compression level. There is no guarantee of the exact position of the change, but if you call this when needsInput is true the change of compression level will occur somewhere near before the end of the so far given input.
SetStrategy Sets the compression strategy. Strategy is one of DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact position where the strategy is changed, the same as for setLevel() applies.
ToString (inherited from Object) Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Deflater Class | ICSharpCode.SharpZipLib.Zip.Compression Namespace