<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.util.zip.Inflater
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.zip.html">This Package</a>  <a href="java.util.zip.GZIPOutputStream.html#_top_">Previous</a>  <a href="java.util.zip.InflaterInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.util.zip.Inflater
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.util.zip.Inflater
</pre>
<hr>
<dl>
  <dt> public class <b>Inflater</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
This 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 RFCs 1950, 1951,
 and 1952, which can be found at
 <a href="http://info.internet.isi.edu:80/in-notes/rfc/files/">
 http://info.internet.isi.edu:80/in-notes/rfc/files/
 </a> in the files rfc1950.txt (zlib format),
 rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.util.zip.Deflater.html#_top_">Deflater</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Inflater()"><b>Inflater</b></a>()
  <dd>  Creates a new decompressor.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Inflater(boolean)"><b>Inflater</b></a>(boolean)
  <dd>  Creates a new decompressor.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#end()"><b>end</b></a>()
  <dd>  Discards unprocessed input and frees internal data.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#finalize()"><b>finalize</b></a>()
  <dd>  Frees the decompressor when garbage is collected.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#finished()"><b>finished</b></a>()
  <dd>  Return true if the end of the compressed data stream has been
 reached.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAdler()"><b>getAdler</b></a>()
  <dd>  Returns the ADLER-32 value of the uncompressed data.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRemaining()"><b>getRemaining</b></a>()
  <dd>  Returns the total number of bytes remaining in the input buffer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getTotalIn()"><b>getTotalIn</b></a>()
  <dd>  Returns the total number of bytes input so far.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getTotalOut()"><b>getTotalOut</b></a>()
  <dd>  Returns the total number of bytes output so far.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#inflate(byte[])"><b>inflate</b></a>(byte[])
  <dd>  Uncompresses bytes into specified buffer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#inflate(byte[], int, int)"><b>inflate</b></a>(byte[], int, int)
  <dd>  Uncompresses bytes into specified buffer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#needsDictionary()"><b>needsDictionary</b></a>()
  <dd>  Returns true if a preset dictionary is needed for decompression.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#needsInput()"><b>needsInput</b></a>()
  <dd>  Returns true if no data remains in the input buffer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#reset()"><b>reset</b></a>()
  <dd>  Resets inflater so that a new set of input data can be processed.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDictionary(byte[])"><b>setDictionary</b></a>(byte[])
  <dd>  Sets the preset dictionary to the given array of bytes.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDictionary(byte[], int, int)"><b>setDictionary</b></a>(byte[], int, int)
  <dd>  Sets the preset dictionary to the given array of bytes.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setInput(byte[])"><b>setInput</b></a>(byte[])
  <dd>  Sets input data for decompression.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setInput(byte[], int, int)"><b>setInput</b></a>(byte[], int, int)
  <dd>  Sets input data for decompression.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Inflater"></a>
<a name="Inflater(boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Inflater</b>
<pre>
 public Inflater(boolean nowrap)
</pre>
<dl>
  <dd> Creates a new decompressor. If the parameter 'nowrap' is true then
 the ZLIB header and checksum fields will not be used in order to
 support the compression format used by both GZIP and PKZIP.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> nowrap - if true then support GZIP compatible compression
  </dl></dd>
</dl>
<a name="Inflater()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Inflater</b>
<pre>
 public Inflater()
</pre>
<dl>
  <dd> Creates a new decompressor.
<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setInput(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setInput"><b>setInput</b></a>
<pre>
 public synchronized void setInput(byte b[],
                                   int off,
                                   int len)
</pre>
<dl>
  <dd> Sets input data for decompression. Should be called whenever
 needsInput() returns true indicating that more input data is
 required.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the input data bytes
    <dd> off - the start offset of the input data
    <dd> len - the length of the input data
    <dt> <b>See Also:</b>
    <dd> <a href="#needsInput">needsInput</a>
  </dl></dd>
</dl>
<a name="setInput(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setInput"><b>setInput</b></a>
<pre>
 public void setInput(byte b[])
</pre>
<dl>
  <dd> Sets input data for decompression. Should be called whenever
 needsInput() returns true indicating that more input data is
 required.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the input data bytes
    <dt> <b>See Also:</b>
    <dd> <a href="#needsInput">needsInput</a>
  </dl></dd>
</dl>
<a name="setDictionary(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDictionary"><b>setDictionary</b></a>
<pre>
 public native synchronized void setDictionary(byte b[],
                                               int off,
                                               int len)
</pre>
<dl>
  <dd> Sets the preset dictionary to the given array of bytes. Should be
 called when inflate() returns 0 and needsDictionary() returns true
 indicating that a preset dictionary is required. The method getAdler()
 can be used to get the Adler-32 value of the dictionary needed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the dictionary data bytes
    <dd> off - the start offset of the data
    <dd> len - the length of the data
    <dt> <b>See Also:</b>
    <dd> <a href="#needsDictionary">needsDictionary</a>, <a href="#getAdler">getAdler</a>
  </dl></dd>
</dl>
<a name="setDictionary(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDictionary"><b>setDictionary</b></a>
<pre>
 public void setDictionary(byte b[])
</pre>
<dl>
  <dd> Sets the preset dictionary to the given array of bytes. Should be
 called when inflate() returns 0 and needsDictionary() returns true
 indicating that a preset dictionary is required. The method getAdler()
 can be used to get the Adler-32 value of the dictionary needed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the dictionary data bytes
    <dt> <b>See Also:</b>
    <dd> <a href="#needsDictionary">needsDictionary</a>, <a href="#getAdler">getAdler</a>
  </dl></dd>
</dl>
<a name="getRemaining()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRemaining"><b>getRemaining</b></a>
<pre>
 public synchronized int getRemaining()
</pre>
<dl>
  <dd> Returns the total number of bytes remaining in the input buffer.
 This can be used to find out what bytes still remain in the input
 buffer after decompression has finished.
<p>
</dl>
<a name="needsInput()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="needsInput"><b>needsInput</b></a>
<pre>
 public synchronized boolean needsInput()
</pre>
<dl>
  <dd> Returns true if no data remains in the input buffer. This can
 be used to determine if #setInput should be called in order
 to provide more input.
<p>
</dl>
<a name="needsDictionary()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="needsDictionary"><b>needsDictionary</b></a>
<pre>
 public synchronized boolean needsDictionary()
</pre>
<dl>
  <dd> Returns true if a preset dictionary is needed for decompression.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> InflatesetDictionary
  </dl></dd>
</dl>
<a name="finished()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finished"><b>finished</b></a>
<pre>
 public synchronized boolean finished()
</pre>
<dl>
  <dd> Return true if the end of the compressed data stream has been
 reached.
<p>
</dl>
<a name="inflate(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="inflate"><b>inflate</b></a>
<pre>
 public native synchronized int inflate(byte b[],
                                        int off,
                                        int len) throws <a href="java.util.zip.DataFormatException.html#_top_">DataFormatException</a>
</pre>
<dl>
  <dd> Uncompresses bytes into specified buffer. Returns actual number
 of bytes uncompressed. A return value of 0 indicates that
 needsInput() or needsDictionary() should be called in order to
 determine if more input data or a preset dictionary is required.
 In the later case, getAdler() can be used to get the Adler-32
 value of the dictionary required.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer for the uncompressed data
    <dd> off - the start offset of the data
    <dd> len - the maximum number of uncompressed bytes
    <dt> <b>Returns:</b>
    <dd> the actual number of uncompressed bytes
    <dt> <b>Throws:</b> <a href="java.util.zip.DataFormatException.html#_top_">DataFormatException</a>
    <dd> if the compressed data format is invalid
    <dt> <b>See Also:</b>
    <dd> <a href="#needsInput">needsInput</a>, <a href="#needsDictionary">needsDictionary</a>
  </dl></dd>
</dl>
<a name="inflate(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="inflate"><b>inflate</b></a>
<pre>
 public int inflate(byte b[]) throws <a href="java.util.zip.DataFormatException.html#_top_">DataFormatException</a>
</pre>
<dl>
  <dd> Uncompresses bytes into specified buffer. Returns actual number
 of bytes uncompressed. A return value of 0 indicates that
 needsInput() or needsDictionary() should be called in order to
 determine if more input data or a preset dictionary is required.
 In the later case, getAdler() can be used to get the Adler-32
 value of the dictionary required.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer for the uncompressed data
    <dt> <b>Returns:</b>
    <dd> the actual number of uncompressed bytes
    <dt> <b>Throws:</b> <a href="java.util.zip.DataFormatException.html#_top_">DataFormatException</a>
    <dd> if the compressed data format is invalid
    <dt> <b>See Also:</b>
    <dd> <a href="#needsInput">needsInput</a>, <a href="#needsDictionary">needsDictionary</a>
  </dl></dd>
</dl>
<a name="getAdler()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAdler"><b>getAdler</b></a>
<pre>
 public native synchronized int getAdler()
</pre>
<dl>
  <dd> Returns the ADLER-32 value of the uncompressed data.
<p>
</dl>
<a name="getTotalIn()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getTotalIn"><b>getTotalIn</b></a>
<pre>
 public native synchronized int getTotalIn()
</pre>
<dl>
  <dd> Returns the total number of bytes input so far.
<p>
</dl>
<a name="getTotalOut()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getTotalOut"><b>getTotalOut</b></a>
<pre>
 public native synchronized int getTotalOut()
</pre>
<dl>
  <dd> Returns the total number of bytes output so far.
<p>
</dl>
<a name="reset()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="reset"><b>reset</b></a>
<pre>
 public native synchronized void reset()
</pre>
<dl>
  <dd> Resets inflater so that a new set of input data can be processed.
<p>
</dl>
<a name="end()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="end"><b>end</b></a>
<pre>
 public native synchronized void end()
</pre>
<dl>
  <dd> Discards unprocessed input and frees internal data.
<p>
</dl>
<a name="finalize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finalize"><b>finalize</b></a>
<pre>
 protected void finalize()
</pre>
<dl>
  <dd> Frees the decompressor when garbage is collected.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#finalize()">finalize</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.zip.html">This Package</a>  <a href="java.util.zip.GZIPOutputStream.html#_top_">Previous</a>  <a href="java.util.zip.InflaterInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
