Package Summary  Overview Summary

class:Deflater [CHANGED]



  • public class Deflater
    extends Object
    
    This class provides support for general purpose compression using the popular ZLIB compression library. The ZLIB compression library was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description .

    The following code fragment demonstrates a trivial compression and decompression of a string using Deflater and Inflater.

     try {
         // Encode a String into bytes
         String inputString = "blahblahblah";
         byte[] input = inputString.getBytes("UTF-8");
    
         // Compress the bytes
         byte[] output = new byte[100];
         Deflater compresser = new Deflater();
         compresser.setInput(input);
         compresser.finish();
         int compressedDataLength = compresser.deflate(output);
         compresser.end();
    
         // Decompress the bytes
         Inflater decompresser = new Inflater();
         decompresser.setInput(output, 0, compressedDataLength);
         byte[] result = new byte[100];
         int resultLength = decompresser.inflate(result);
         decompresser.end();
    
         // Decode the bytes into a String
         String outputString = new String(result, 0, resultLength, "UTF-8");
     } catch(java.io.UnsupportedEncodingException ex) {
         // handle
     } catch (java.util.zip.DataFormatException ex) {
         // handle
     }
     
    Since:
    1.1
    See Also:
    Inflater


  • public class Deflater
    extends Object
    
    This class provides support for general purpose compression using the popular ZLIB compression library. The ZLIB compression library was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description .

    The following code fragment demonstrates a trivial compression and decompression of a string using Deflater and Inflater.

     try {
         // Encode a String into bytes
         String inputString = "blahblahblah";
         byte[] input = inputString.getBytes("UTF-8");
    
         // Compress the bytes
         byte[] output = new byte[100];
         Deflater compresser = new Deflater();
         compresser.setInput(input);
         compresser.finish();
         int compressedDataLength = compresser.deflate(output);
         compresser.end();
    
         // Decompress the bytes
         Inflater decompresser = new Inflater();
         decompresser.setInput(output, 0, compressedDataLength);
         byte[] result = new byte[100];
         int resultLength = decompresser.inflate(result);
         decompresser.end();
    
         // Decode the bytes into a String
         String outputString = new String(result, 0, resultLength, "UTF-8");
     } catch(java.io.UnsupportedEncodingException ex) {
         // handle
     } catch (java.util.zip.DataFormatException ex) {
         // handle
     }
     
    See Also:
    Inflater


  • public class Deflater
    extends Object
    
    This class provides support for general purpose compression using the popular ZLIB compression library. The ZLIB compression library was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description .

    The following code fragment demonstrates a trivial compression and decompression of a string using Deflater and Inflater.

     try {
         // Encode a String into bytes
         String inputString = "blahblahblah";
         byte[] input = inputString.getBytes("UTF-8");
    
         // Compress the bytes
         byte[] output = new byte[100];
         Deflater compresser = new Deflater();
         compresser.setInput(input);
         compresser.finish();
         int compressedDataLength = compresser.deflate(output);
         compresser.end();
    
         // Decompress the bytes
         Inflater decompresser = new Inflater();
         decompresser.setInput(output, 0, compressedDataLength);
         byte[] result = new byte[100];
         int resultLength = decompresser.inflate(result);
         decompresser.end();
    
         // Decode the bytes into a String
         String outputString = new String(result, 0, resultLength, "UTF-8");
     } catch(java.io.UnsupportedEncodingException ex) {
         // handle
     } catch (java.util.zip.DataFormatException ex) {
         // handle
     }
     
    Since:
    1.1
    See Also:
    Inflater

field:DEFLATED [NONE]

  • DEFLATED

    public static final int DEFLATED
    Compression method for the deflate algorithm (the only one currently supported).
    See Also:
    Constant Field Values

field:NO_COMPRESSION [NONE]

  • NO_COMPRESSION

    public static final int NO_COMPRESSION
    Compression level for no compression.
    See Also:
    Constant Field Values

field:BEST_SPEED [NONE]

  • BEST_SPEED

    public static final int BEST_SPEED
    Compression level for fastest compression.
    See Also:
    Constant Field Values

field:BEST_COMPRESSION [NONE]

  • BEST_COMPRESSION

    public static final int BEST_COMPRESSION
    Compression level for best compression.
    See Also:
    Constant Field Values

field:DEFAULT_COMPRESSION [NONE]

  • DEFAULT_COMPRESSION

    public static final int DEFAULT_COMPRESSION
    Default compression level.
    See Also:
    Constant Field Values

field:FILTERED [NONE]

  • FILTERED

    public static final int FILTERED
    Compression strategy best used for data consisting mostly of small values with a somewhat random distribution. Forces more Huffman coding and less string matching.
    See Also:
    Constant Field Values

field:HUFFMAN_ONLY [NONE]

  • HUFFMAN_ONLY

    public static final int HUFFMAN_ONLY
    Compression strategy for Huffman coding only.
    See Also:
    Constant Field Values

field:DEFAULT_STRATEGY [NONE]

  • DEFAULT_STRATEGY

    public static final int DEFAULT_STRATEGY
    Default compression strategy.
    See Also:
    Constant Field Values

field:NO_FLUSH [NONE]

field:SYNC_FLUSH [NONE]

field:FULL_FLUSH [NONE]

  • FULL_FLUSH

    public static final int FULL_FLUSH
    Compression flush mode used to flush out all pending output and reset the deflater. Using this mode too often can seriously degrade compression.
    Since:
    1.7
    See Also:
    deflate(byte[], int, int, int) , Constant Field Values

constructor:Deflater(int, boolean) [CHANGED]

  • Deflater

    public Deflaterpublic Deflater​(int level,
                    boolean nowrap)
    Creates a new compressor using the specified compression level. If 'nowrap' is true then the ZLIB header and checksum fields will not be used in order to support the compression format used in both GZIP and PKZIP.
    Parameters:
    level - the compression level (0-9)
    nowrap - if true then use GZIP compatible compression
  • Deflater

    public Deflater(int level,
                    boolean nowrap)
    Creates a new compressor using the specified compression level. If 'nowrap' is true then the ZLIB header and checksum fields will not be used in order to support the compression format used in both GZIP and PKZIP.
    Parameters:
    level - the compression level (0-9)
    nowrap - if true then use GZIP compatible compression
  • Deflater

    public Deflater​(int level,
                    boolean nowrap)
    Creates a new compressor using the specified compression level. If 'nowrap' is true then the ZLIB header and checksum fields will not be used in order to support the compression format used in both GZIP and PKZIP.
    Parameters:
    level - the compression level (0-9)
    nowrap - if true then use GZIP compatible compression

constructor:Deflater(int) [CHANGED]

  • Deflater

    public Deflaterpublic Deflater​(int level)
    Creates a new compressor using the specified compression level. Compressed data will be generated in ZLIB format.
    Parameters:
    level - the compression level (0-9)
  • Deflater

    public Deflater(int level)
    Creates a new compressor using the specified compression level. Compressed data will be generated in ZLIB format.
    Parameters:
    level - the compression level (0-9)
  • Deflater

    public Deflater​(int level)
    Creates a new compressor using the specified compression level. Compressed data will be generated in ZLIB format.
    Parameters:
    level - the compression level (0-9)

constructor:Deflater() [CHANGED]

  • Deflater

    public Deflaterpublic Deflater​()
    Creates a new compressor with the default compression level. Compressed data will be generated in ZLIB format.
  • Deflater

    public Deflater()
    Creates a new compressor with the default compression level. Compressed data will be generated in ZLIB format.
  • Deflater

    public Deflater​()
    Creates a new compressor with the default compression level. Compressed data will be generated in ZLIB format.

method:setInput(byte[], int, int) [CHANGED]

  • setInput

    public void setInputpublic void setInput​(byte[] b,
                         int off,
                         int len)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    needsInput()
  • setInput

    public void setInput(byte[] b,
                         int off,
                         int len)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    needsInput()
  • setInput

    public void setInput​(byte[] b,
                         int off,
                         int len)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    needsInput()

method:setInput(byte[]) [CHANGED]

  • setInput

    public void setInputpublic void setInput​(byte[] b)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    See Also:
    needsInput()
  • setInput

    public void setInput(byte[] b)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    See Also:
    needsInput()
  • setInput

    public void setInput​(byte[] b)
    Sets input data for compression. This should be called whenever needsInput() returns true indicating that more input data is required.
    Parameters:
    b - the input data bytes
    See Also:
    needsInput()

method:setDictionary(byte[], int, int) [CHANGED]

  • setDictionary

    public void setDictionarypublic void setDictionary​(byte[] b,
                              int off,
                              int len)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()
  • setDictionary

    public void setDictionary(byte[] b,
                              int off,
                              int len)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()
  • setDictionary

    public void setDictionary​(byte[] b,
                              int off,
                              int len)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    off - the start offset of the data
    len - the length of the data
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()

method:setDictionary(byte[]) [CHANGED]

  • setDictionary

    public void setDictionarypublic void setDictionary​(byte[] b)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()
  • setDictionary

    public void setDictionary(byte[] b)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()
  • setDictionary

    public void setDictionary​(byte[] b)
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined. When the data is later uncompressed with Inflater.inflate(), Inflater.getAdler() can be called in order to get the Adler-32 value of the dictionary required for decompression.
    Parameters:
    b - the dictionary data bytes
    See Also:
    Inflater.inflate(byte[], int, int) , Inflater.getAdler()

method:setStrategy(int) [CHANGED]

  • setStrategy

    public void setStrategypublic void setStrategy​(int strategy)
    Sets the compression strategy to the specified value.

    If the compression strategy is changed, the next invocation of deflate will compress the input available so far with the old strategy (and may be flushed); the new strategy will take effect only after that invocation.

    Parameters:
    strategy - the new compression strategy
    Throws:
    IllegalArgumentException - if the compression strategy is invalid
  • setStrategy

    public void setStrategy(int strategy)
    Sets the compression strategy to the specified value.

    If the compression strategy is changed, the next invocation of deflate will compress the input available so far with the old strategy (and may be flushed); the new strategy will take effect only after that invocation.

    Parameters:
    strategy - the new compression strategy
    Throws:
    IllegalArgumentException - if the compression strategy is invalid
  • setStrategy

    public void setStrategy​(int strategy)
    Sets the compression strategy to the specified value.

    If the compression strategy is changed, the next invocation of deflate will compress the input available so far with the old strategy (and may be flushed); the new strategy will take effect only after that invocation.

    Parameters:
    strategy - the new compression strategy
    Throws:
    IllegalArgumentException - if the compression strategy is invalid

method:setLevel(int) [CHANGED]

  • setLevel

    public void setLevelpublic void setLevel​(int level)
    Sets the compression level to the specified value.

    If the compression level is changed, the next invocation of deflate will compress the input available so far with the old level (and may be flushed); the new level will take effect only after that invocation.

    Parameters:
    level - the new compression level (0-9)
    Throws:
    IllegalArgumentException - if the compression level is invalid
  • setLevel

    public void setLevel(int level)
    Sets the compression level to the specified value.

    If the compression level is changed, the next invocation of deflate will compress the input available so far with the old level (and may be flushed); the new level will take effect only after that invocation.

    Parameters:
    level - the new compression level (0-9)
    Throws:
    IllegalArgumentException - if the compression level is invalid
  • setLevel

    public void setLevel​(int level)
    Sets the compression level to the specified value.

    If the compression level is changed, the next invocation of deflate will compress the input available so far with the old level (and may be flushed); the new level will take effect only after that invocation.

    Parameters:
    level - the new compression level (0-9)
    Throws:
    IllegalArgumentException - if the compression level is invalid

method:needsInput() [CHANGED]

  • needsInput

    public boolean needsInputpublic boolean needsInput​()
    Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
    Returns:
    true if the input data buffer is empty and setInput() should be called in order to provide more input
  • needsInput

    public boolean needsInput()
    Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
    Returns:
    true if the input data buffer is empty and setInput() should be called in order to provide more input
  • needsInput

    public boolean needsInput​()
    Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
    Returns:
    true if the input data buffer is empty and setInput() should be called in order to provide more input

method:finish() [CHANGED]

  • finish

    public void finishpublic void finish​()
    When called, indicates that compression should end with the current contents of the input buffer.
  • finish

    public void finish()
    When called, indicates that compression should end with the current contents of the input buffer.
  • finish

    public void finish​()
    When called, indicates that compression should end with the current contents of the input buffer.

method:finished() [CHANGED]

  • finished

    public boolean finishedpublic boolean finished​()
    Returns true if the end of the compressed data output stream has been reached.
    Returns:
    true if the end of the compressed data output stream has been reached
  • finished

    public boolean finished()
    Returns true if the end of the compressed data output stream has been reached.
    Returns:
    true if the end of the compressed data output stream has been reached
  • finished

    public boolean finished​()
    Returns true if the end of the compressed data output stream has been reached.
    Returns:
    true if the end of the compressed data output stream has been reached

method:deflate(byte[], int, int) [CHANGED]

  • deflate

    public int deflatepublic int deflate​(byte[] b,
                       int off,
                       int len)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b, off, len) yields the same result as the invocation of deflater.deflate(b, off, len, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer
  • deflate

    public int deflate(byte[] b,
                       int off,
                       int len)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b, off, len) yields the same result as the invocation of deflater.deflate(b, off, len, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer
  • deflate

    public int deflate​(byte[] b,
                       int off,
                       int len)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b, off, len) yields the same result as the invocation of deflater.deflate(b, off, len, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer

method:deflate(byte[]) [CHANGED]

  • deflate

    public int deflatepublic int deflate​(byte[] b)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b) yields the same result as the invocation of deflater.deflate(b, 0, b.length, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer
  • deflate

    public int deflate(byte[] b)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b) yields the same result as the invocation of deflater.deflate(b, 0, b.length, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer
  • deflate

    public int deflate​(byte[] b)
    Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.

    This method uses NO_FLUSH as its compression flush mode. An invocation of this method of the form deflater.deflate(b) yields the same result as the invocation of deflater.deflate(b, 0, b.length, Deflater.NO_FLUSH) .

    Parameters:
    b - the buffer for the compressed data
    Returns:
    the actual number of bytes of compressed data written to the output buffer

method:deflate(byte[], int, int, int) [CHANGED]

  • deflate

    public int deflatepublic int deflate​(byte[] b,
                       int off,
                       int len,
                       int flush)
    Compresses the input data and fills the specified buffer with compressed data. Returns actual number of bytes of data compressed.

    Compression flush mode is one of the following three modes:

    • NO_FLUSH: allows the deflater to decide how much data to accumulate, before producing output, in order to achieve the best compression (should be used in normal use scenario). A return value of 0 in this flush mode indicates that needsInput() should be called in order to determine if more input data is required.
    • SYNC_FLUSH: all pending output in the deflater is flushed, to the specified output buffer, so that an inflater that works on compressed data can get all input data available so far (In particular the needsInput() returns true after this invocation if enough output space is provided). Flushing with SYNC_FLUSH may degrade compression for some compression algorithms and so it should be used only when necessary.
    • FULL_FLUSH: all pending output is flushed out as with SYNC_FLUSH. The compression state is reset so that the inflater that works on the compressed output data can restart from this point if previous compressed data has been damaged or if random access is desired. Using FULL_FLUSH too often can seriously degrade compression.

    In the case of FULL_FLUSH or SYNC_FLUSH, if the return value is len, the space available in output buffer b, this method should be invoked again with the same flush parameter and more output space. Make sure that len is greater than 6 to avoid flush marker (5 bytes) being repeatedly output to the output buffer every time this method is invoked.

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    flush - the compression flush mode
    Returns:
    the actual number of bytes of compressed data written to the output buffer
    Throws:
    IllegalArgumentException - if the flush mode is invalid
    Since:
    1.7
  • deflate

    public int deflate(byte[] b,
                       int off,
                       int len,
                       int flush)
    Compresses the input data and fills the specified buffer with compressed data. Returns actual number of bytes of data compressed.

    Compression flush mode is one of the following three modes:

    • NO_FLUSH: allows the deflater to decide how much data to accumulate, before producing output, in order to achieve the best compression (should be used in normal use scenario). A return value of 0 in this flush mode indicates that needsInput() should be called in order to determine if more input data is required.
    • SYNC_FLUSH: all pending output in the deflater is flushed, to the specified output buffer, so that an inflater that works on compressed data can get all input data available so far (In particular the needsInput() returns true after this invocation if enough output space is provided). Flushing with SYNC_FLUSH may degrade compression for some compression algorithms and so it should be used only when necessary.
    • FULL_FLUSH: all pending output is flushed out as with SYNC_FLUSH. The compression state is reset so that the inflater that works on the compressed output data can restart from this point if previous compressed data has been damaged or if random access is desired. Using FULL_FLUSH too often can seriously degrade compression.

    In the case of FULL_FLUSH or SYNC_FLUSH, if the return value is len, the space available in output buffer b, this method should be invoked again with the same flush parameter and more output space.

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    flush - the compression flush mode
    Returns:
    the actual number of bytes of compressed data written to the output buffer
    Throws:
    IllegalArgumentException - if the flush mode is invalid
    Since:
    1.7
  • deflate

    public int deflate​(byte[] b,
                       int off,
                       int len,
                       int flush)
    Compresses the input data and fills the specified buffer with compressed data. Returns actual number of bytes of data compressed.

    Compression flush mode is one of the following three modes:

    • NO_FLUSH: allows the deflater to decide how much data to accumulate, before producing output, in order to achieve the best compression (should be used in normal use scenario). A return value of 0 in this flush mode indicates that needsInput() should be called in order to determine if more input data is required.
    • SYNC_FLUSH: all pending output in the deflater is flushed, to the specified output buffer, so that an inflater that works on compressed data can get all input data available so far (In particular the needsInput() returns true after this invocation if enough output space is provided). Flushing with SYNC_FLUSH may degrade compression for some compression algorithms and so it should be used only when necessary.
    • FULL_FLUSH: all pending output is flushed out as with SYNC_FLUSH. The compression state is reset so that the inflater that works on the compressed output data can restart from this point if previous compressed data has been damaged or if random access is desired. Using FULL_FLUSH too often can seriously degrade compression.

    In the case of FULL_FLUSH or SYNC_FLUSH, if the return value is len, the space available in output buffer b, this method should be invoked again with the same flush parameter and more output space. Make sure that len is greater than 6 to avoid flush marker (5 bytes) being repeatedly output to the output buffer every time this method is invoked.

    Parameters:
    b - the buffer for the compressed data
    off - the start offset of the data
    len - the maximum number of bytes of compressed data
    flush - the compression flush mode
    Returns:
    the actual number of bytes of compressed data written to the output buffer
    Throws:
    IllegalArgumentException - if the flush mode is invalid
    Since:
    1.7

method:getAdler() [CHANGED]

  • getAdler

    public int getAdlerpublic int getAdler​()
    Returns the ADLER-32 value of the uncompressed data.
    Returns:
    the ADLER-32 value of the uncompressed data
  • getAdler

    public int getAdler()
    Returns the ADLER-32 value of the uncompressed data.
    Returns:
    the ADLER-32 value of the uncompressed data
  • getAdler

    public int getAdler​()
    Returns the ADLER-32 value of the uncompressed data.
    Returns:
    the ADLER-32 value of the uncompressed data

method:getTotalIn() [CHANGED]

  • getTotalIn

    public int getTotalInpublic int getTotalIn​()
    Returns the total number of uncompressed bytes input so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesRead() method is now the preferred means of obtaining this information.

    Returns:
    the total number of uncompressed bytes input so far
  • getTotalIn

    public int getTotalIn()
    Returns the total number of uncompressed bytes input so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesRead() method is now the preferred means of obtaining this information.

    Returns:
    the total number of uncompressed bytes input so far
  • getTotalIn

    public int getTotalIn​()
    Returns the total number of uncompressed bytes input so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesRead() method is now the preferred means of obtaining this information.

    Returns:
    the total number of uncompressed bytes input so far

method:getBytesRead() [CHANGED]

  • getBytesRead

    public long getBytesReadpublic long getBytesRead​()
    Returns the total number of uncompressed bytes input so far.
    Returns:
    the total (non-negative) number of uncompressed bytes input so far
    Since:
    1.5
  • getBytesRead

    public long getBytesRead()
    Returns the total number of uncompressed bytes input so far.
    Returns:
    the total (non-negative) number of uncompressed bytes input so far
    Since:
    1.5
  • getBytesRead

    public long getBytesRead​()
    Returns the total number of uncompressed bytes input so far.
    Returns:
    the total (non-negative) number of uncompressed bytes input so far
    Since:
    1.5

method:getTotalOut() [CHANGED]

  • getTotalOut

    public int getTotalOutpublic int getTotalOut​()
    Returns the total number of compressed bytes output so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesWritten() method is now the preferred means of obtaining this information.

    Returns:
    the total number of compressed bytes output so far
  • getTotalOut

    public int getTotalOut()
    Returns the total number of compressed bytes output so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesWritten() method is now the preferred means of obtaining this information.

    Returns:
    the total number of compressed bytes output so far
  • getTotalOut

    public int getTotalOut​()
    Returns the total number of compressed bytes output so far.

    Since the number of bytes may be greater than Integer.MAX_VALUE, the getBytesWritten() method is now the preferred means of obtaining this information.

    Returns:
    the total number of compressed bytes output so far

method:getBytesWritten() [CHANGED]

  • getBytesWritten

    public long getBytesWrittenpublic long getBytesWritten​()
    Returns the total number of compressed bytes output so far.
    Returns:
    the total (non-negative) number of compressed bytes output so far
    Since:
    1.5
  • getBytesWritten

    public long getBytesWritten()
    Returns the total number of compressed bytes output so far.
    Returns:
    the total (non-negative) number of compressed bytes output so far
    Since:
    1.5
  • getBytesWritten

    public long getBytesWritten​()
    Returns the total number of compressed bytes output so far.
    Returns:
    the total (non-negative) number of compressed bytes output so far
    Since:
    1.5

method:reset() [CHANGED]

  • reset

    public void resetpublic void reset​()
    Resets deflater so that a new set of input data can be processed. Keeps current compression level and strategy settings.
  • reset

    public void reset()
    Resets deflater so that a new set of input data can be processed. Keeps current compression level and strategy settings.
  • reset

    public void reset​()
    Resets deflater so that a new set of input data can be processed. Keeps current compression level and strategy settings.

method:end() [CHANGED]

  • end

    public void endpublic void end​()
    Closes the compressor and discards any unprocessed input. This method should be called when the compressor is no longer being used, but will also be called automatically by the finalize() method. Once this method is called, the behavior of the Deflater object is undefined.
  • end

    public void end()
    Closes the compressor and discards any unprocessed input. This method should be called when the compressor is no longer being used, but will also be called automatically by the finalize() method. Once this method is called, the behavior of the Deflater object is undefined.
  • end

    public void end​()
    Closes the compressor and discards any unprocessed input. This method should be called when the compressor is no longer being used, but will also be called automatically by the finalize() method. Once this method is called, the behavior of the Deflater object is undefined.

method:finalize() [CHANGED]

  • finalizeprotected void finalize

    @Deprecated(since="9")
    protected void finalize​()
    Deprecated. The finalize method has been deprecated. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. When overriding the finalize method, its implementation must explicitly ensure that super.finalize() is invoked as described in Object.finalize(). See the specification for Object.finalize() for further information about migration options.
    Closes the compressor when garbage is collected.
    Overrides:
    finalize in class Object
    See Also:
    WeakReference, PhantomReference
  • finalize

    @Deprecated(since="9")
    protected void finalize​()
    Deprecated. The finalize method has been deprecated. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. When overriding the finalize method, its implementation must explicitly ensure that super.finalize() is invoked as described in Object.finalize(). See the specification for Object.finalize() for further information about migration options.
    Closes the compressor when garbage is collected.
    Overrides:
    finalize in class Object
    See Also:
    WeakReference, PhantomReference

© 2017 Oracle Corporation and/or its affiliates