Inflater 

Introduction

The java.util.zip.Inflater class provides support for general purpose decompression 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.

Class Declaration

Following is the declaration for java.util.zip.Inflater class −

publicclassInflaterextendsObject

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

Constructors

Sr.No.Constructor & Description
1Inflater()Creates a new decompressor.
2Inflater(boolean nowrap)Creates a new decompressor.

Class Methods

Sr.No.Method & Description
1void end()Closes the decompressor and discards any unprocessed input.
2boolean finished()Returns true if the end of the compressed data stream has been reached.
3int getAdler()Returns the ADLER-32 value of the uncompressed data.
4long getBytesRead()Returns the total number of compressed bytes input so far.
5long getBytesWritten()Returns the total number of uncompressed bytes output so far.
6int getRemaining()Returns the total number of bytes remaining in the input buffer.
7int getTotalIn()Returns the total number of compressed bytes input so far.
8int getTotalOut()Returns the total number of uncompressed bytes output so far.
9int inflate(byte[] b)Uncompresses bytes into specified buffer.
10int inflate(byte[] b, int off, int len)Uncompresses bytes into specified buffer.
11boolean needsDictionary()Returns true if a preset dictionary is needed for decompression.
12boolean needsInput()Returns true if no data remains in the input buffer.
13void reset()Resets inflater so that a new set of input data can be processed.
14void setDictionary(byte[] b)Sets the preset dictionary to the given array of bytes.
15void setDictionary(byte[] b, int off, int len)Sets the preset dictionary to the given array of bytes.
16void setInput(byte[] b)Sets input data for decompression.
17void setInput(byte[] b, int off, int len)Sets input data for decompression.

Methods Inherited

This class inherits methods from the following classes −

  • java.lang.Object

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *