|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream java.util.zip.InflaterInputStream java.util.zip.GZIPInputStream
This class implements a stream filter for reading compressed data in the GZIP format.
InflaterInputStream
Field Summary | |
private boolean |
closed
|
protected CRC32 |
crc
CRC-32 for uncompressed data. |
protected boolean |
eos
Indicates end of input stream. |
private static int |
FCOMMENT
|
private static int |
FEXTRA
|
private static int |
FHCRC
|
private static int |
FNAME
|
private static int |
FTEXT
|
static int |
GZIP_MAGIC
GZIP header magic number. |
private byte[] |
tmpbuf
|
Fields inherited from class java.util.zip.InflaterInputStream |
buf, inf, len, usesDefaultInflater |
Fields inherited from class java.io.FilterInputStream |
in |
Fields inherited from class java.io.InputStream |
|
Constructor Summary | |
GZIPInputStream(InputStream in)
Creates a new input stream with a default buffer size. |
|
GZIPInputStream(InputStream in,
int size)
Creates a new input stream with the specified buffer size. |
Method Summary | |
void |
close()
Closes the input stream. |
private void |
ensureOpen()
Check to make sure that this stream has not been closed |
int |
read(byte[] buf,
int off,
int len)
Reads uncompressed data into an array of bytes. |
private void |
readHeader()
|
private void |
readTrailer()
|
private int |
readUByte(InputStream in)
|
private long |
readUInt(InputStream in)
|
private int |
readUShort(InputStream in)
|
private void |
skipBytes(InputStream in,
int n)
|
Methods inherited from class java.util.zip.InflaterInputStream |
available, fill, read, skip |
Methods inherited from class java.io.FilterInputStream |
mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected CRC32 crc
protected boolean eos
private boolean closed
public static final int GZIP_MAGIC
private static final int FTEXT
private static final int FHCRC
private static final int FEXTRA
private static final int FNAME
private static final int FCOMMENT
private byte[] tmpbuf
Constructor Detail |
public GZIPInputStream(InputStream in, int size) throws IOException
in
- the input streamsize
- the input buffer size
IOException
- if an I/O error has occurred
IllegalArgumentException
- if size is <= 0public GZIPInputStream(InputStream in) throws IOException
in
- the input stream
IOException
- if an I/O error has occurredMethod Detail |
private void ensureOpen() throws IOException
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
in class InflaterInputStream
buf
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
IOException
- if an I/O error has occurred or the compressed
input data is corruptpublic void close() throws IOException
close
in class InflaterInputStream
IOException
- if an I/O error has occurredprivate void readHeader() throws IOException
IOException
private void readTrailer() throws IOException
IOException
private long readUInt(InputStream in) throws IOException
IOException
private int readUShort(InputStream in) throws IOException
IOException
private int readUByte(InputStream in) throws IOException
IOException
private void skipBytes(InputStream in, int n) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |