Fields
| Name | Description |
|---|---|
| BEST_COMPRESSION | Compression level for best compression. |
| BEST_SPEED | Compression level for fastest compression. |
| DEFAULT_COMPRESSION | Default compression level. |
| DEFAULT_STRATEGY | Default compression strategy. |
| DEFLATED | Compression method for the deflate algorithm (the only one currently supported). |
| FILTERED | Compression strategy best used for data consisting mostly of small values with a somewhat random distribution. |
| HUFFMAN_ONLY | Compression strategy for Huffman coding only. |
| NO_COMPRESSION | Compression level for no compression. |
Constructors
| Name | Description |
|---|---|
| Deflater() | Creates a new compressor with the default compression level. |
| Deflater(int) | Creates a new compressor using the specified compression level. |
| Deflater(int, boolean) | Creates a new compressor using the specified compression level. |
Methods
| Name | Description |
|---|---|
| deflate(byte[]) | Fills specified buffer with compressed data. |
| deflate(byte[], int, int) | Fills specified buffer with compressed data. |
| end() | Discards unprocessed input and frees internal data. |
| finalize() | Frees the compressor when garbage is collected. |
| finish() | When called, indicates that compression should end with the current contents of the input buffer. |
| finished() | Returns true if the end of the compressed data output stream has been reached. |
| getAdler() | Returns the ADLER-32 value of the uncompressed data. |
| getTotalIn() | Returns the total number of bytes input so far. |
| getTotalOut() | Returns the total number of bytes output so far. |
| needsInput() | Returns true if the input data buffer is empty and setInput() should be called in order to provide more input. |
| reset() | Resets deflater so that a new set of input data can be processed. |
| setDictionary(byte[]) | Sets preset dictionary for compression. |
| setDictionary(byte[], int, int) | Sets preset dictionary for compression. |
| setInput(byte[]) | Sets input data for compression. |
| setInput(byte[], int, int) | Sets input data for compression. |
| setLevel(int) | Sets the current compression level to the specified value. |
| setStrategy(int) | Sets the compression strategy to the specified value. |