API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.zip. Deflater View Source
Author(s)
David Connelly
Since
Version
1.45, 04/07/06
Serial
Hierarchy
 Object
      Deflater
Implements
Subclasses
Description
public class Deflater
  This class provides support for general purpose compression using the popular ZLIB compression library.
See also:    Inflater
Constructors
public Deflater ()
  Creates a new compressor with the default compression level.
public Deflater (int level)
  Creates a new compressor using the specified compression level.
public Deflater (int level, boolean nowrap)
  Creates a new compressor using the specified compression level.
Methods
Hide/Show inherited methods
public int deflate (byte[] b)
  Fills specified buffer with compressed data.
publicsynchronized int deflate (byte[] b, int off, int len)
  Fills specified buffer with compressed data.
publicsynchronized void end ()
  Closes the compressor and discards any unprocessed input.
protected void finalize ()
Closes the compressor when garbage is collected.
publicsynchronized void finish ()
When called, indicates that compression should end with the current contents of the input buffer.
publicsynchronized boolean finished ()
  Returns true if the end of the compressed data output stream has been reached.
publicsynchronized int getAdler ()
  Returns the ADLER-32 value of the uncompressed data.
publicsynchronized long getBytesRead ()
  Returns the total number of uncompressed bytes input so far.
publicsynchronized long getBytesWritten ()
  Returns the total number of compressed bytes output so far.
public int getTotalIn ()
  Returns the total number of uncompressed bytes input so far.
public int getTotalOut ()
  Returns the total number of compressed bytes output so far.
public boolean needsInput ()
  Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
publicsynchronized void reset ()
  Resets deflater so that a new set of input data can be processed.
public void setDictionary (byte[] b)
  Sets preset dictionary for compression.
publicsynchronized void setDictionary (byte[] b, int off, int len)
  Sets preset dictionary for compression.
public void setInput (byte[] b)
  Sets input data for compression.
publicsynchronized void setInput (byte[] b, int off, int len)
  Sets input data for compression.
publicsynchronized void setLevel (int level)
  Sets the current compression level to the specified value.
publicsynchronized void setStrategy (int strategy)
  Sets the compression strategy to the specified value.
Fields
Hide/Show inherited fields
publicfinalstatic int BEST_COMPRESSION = "9"
Compression level for best compression.
publicfinalstatic int BEST_SPEED = "1"
Compression level for fastest compression.
publicfinalstatic int DEFAULT_COMPRESSION = "-1"
Default compression level.
publicfinalstatic int DEFAULT_STRATEGY = "0"
Default compression strategy.
publicfinalstatic int DEFLATED = "8"
Compression method for the deflate algorithm (the only one currently supported).
publicfinalstatic int FILTERED = "1"
  Compression strategy best used for data consisting mostly of small values with a somewhat random distribution.
publicfinalstatic int HUFFMAN_ONLY = "2"
Compression strategy for Huffman coding only.
publicfinalstatic int NO_COMPRESSION = "0"
Compression level for no compression.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar