java.util.zip
Class InflaterInputStream
- AutoCloseable, Closeable
This filter stream is used to decompress data compressed in the "deflate"
format. The "deflate" format is described in RFC 1951.
This stream may form the basis for other decompression filters, such
as the GZIPInputStream
.
protected byte[] | buf - Byte array used as a buffer
|
protected Inflater | inf - Decompressor for this filter
|
protected int | len - Size of buffer
|
int | available() - Returns 0 once the end of the stream (EOF) has been reached.
|
void | close() - Closes the input stream
|
protected void | fill() - Fills the buffer with more data to decompress.
|
void | mark(int readLimit) - This method marks a position in the input to which the stream can
be "reset" by calling the
reset() method.
|
boolean | markSupported() - This method returns a boolean that indicates whether the mark/reset
methods are supported in this class.
|
int | read() - Reads one byte of decompressed data.
|
int | read(byte[] b, int off, int len) - Decompresses data into the byte array
|
void | reset() - This method resets a stream to the point where the
mark() method was called.
|
long | skip(long n) - Skip specified number of bytes of uncompressed data
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
buf
protected byte[] buf
Byte array used as a buffer
len
protected int len
Size of buffer
InflaterInputStream
public InflaterInputStream(InputStream in)
Create an InflaterInputStream with the default decompresseor
and a default buffer size.
in
- the InputStream to read bytes from
InflaterInputStream
public InflaterInputStream(InputStream in,
Inflater inf)
Create an InflaterInputStream with the specified decompresseor
and a default buffer size.
in
- the InputStream to read bytes frominf
- the decompressor used to decompress data read from in
InflaterInputStream
public InflaterInputStream(InputStream in,
Inflater inf,
int size)
Create an InflaterInputStream with the specified decompresseor
and a specified buffer size.
in
- the InputStream to read bytes frominf
- the decompressor used to decompress data read from insize
- size of the buffer to use
fill
protected void fill()
throws IOException
Fills the buffer with more data to decompress.
mark
public void mark(int readLimit)
This method marks a position in the input to which the stream can
be "reset" by calling the
reset()
method. The
parameter @code{readlimit} is the number of bytes that can be read
from the stream after setting the mark before the mark becomes
invalid. For example, if
mark()
is called with a
read limit of 10, then when 11 bytes of data are read from the
stream before the
reset()
method is called, then the
mark is invalid and the stream object instance is not required to
remember the mark.
This method does nothing in this class, but subclasses may override it
to provide mark/reset functionality.
- mark in interface FilterInputStream
readLimit
- The number of bytes that can be read before the
mark becomes invalid
markSupported
public boolean markSupported()
This method returns a boolean that indicates whether the mark/reset
methods are supported in this class. Those methods can be used to
remember a specific point in the stream and reset the stream to that
point.
This method always returns
false
in this class, but
subclasses can override this method to return
true
if they support mark/reset functionality.
- markSupported in interface FilterInputStream
true
if mark/reset functionality is
supported, false
otherwise
read
public int read(byte[] b,
int off,
int len)
throws IOException
Decompresses data into the byte array
- read in interface FilterInputStream
b
- the array to read and decompress data intooff
- the offset indicating where the data should be placedlen
- the number of bytes to decompress
reset
public void reset()
throws IOException
This method resets a stream to the point where the
mark()
method was called. Any bytes that were read
after the mark point was set will be re-read during subsequent
reads.
This method always throws an IOException in this class, but subclasses
can override this method if they provide mark/reset functionality.
- reset in interface FilterInputStream
InflaterInputStream.java - Input stream filter for decompressing
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.