java.util.zip
Class GZIPInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
java.util.zip.GZIPInputStream
- All Implemented Interfaces:
- Closeable
public class GZIPInputStream
- extends InflaterInputStream
The GZIPInputStream class is used to read data stored in the GZIP format.
|
Method Summary |
void |
close()
Closes this stream and any underlying streams. |
int |
read(byte[] buffer,
int off,
int nbytes)
Reads and decompresses GZIP data from the underlying stream into buf. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
crc
protected CRC32 crc
eos
protected boolean eos
GZIP_MAGIC
public static final int GZIP_MAGIC
- See Also:
- Constant Field Values
GZIPInputStream
public GZIPInputStream(InputStream is)
throws IOException
- Construct a GZIPInputStream to read from GZIP data from the underlying
stream
- Parameters:
is - InputStream to read data from
- Throws:
IOException
GZIPInputStream
public GZIPInputStream(InputStream is,
int size)
throws IOException
- Construct a GZIPInputStream to read from GZIP data from the underlying
stream. Set the internal buffer size to size
- Parameters:
is - InputStream to read data fromsize - Internal read buffer size
- Throws:
IOException
read
public int read(byte[] buffer,
int off,
int nbytes)
throws IOException
- Reads and decompresses GZIP data from the underlying stream into buf.
- Overrides:
read in class InflaterInputStream
- Parameters:
buffer - Buffer to receive dataoff - Offset in buffer to store datanbytes - Number of bytes to read
- Returns:
- Number of uncompressed bytes read
- Throws:
IOException - If an error occurs reading
close
public void close()
throws IOException
- Closes this stream and any underlying streams.
- Specified by:
close in interface Closeable- Overrides:
close in class InflaterInputStream
- Throws:
IOException - If an error occurs closing the stream
Please submit a feedback, bug or feature