|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
de.enough.polish.util.zip.GZipInputStream
public class GZipInputStream
Reads and uncompresses GZIP or DEFLATE encoded input streams.
Copyright Enough Software 2007 - 2010
history
Jun 25, 2007 - Simon creation
| Field Summary | |
|---|---|
static int |
TYPE_DEFLATE
This constant triggers the normal deflate compression as described in rfc 1951. |
static int |
TYPE_GZIP
This constant triggers the gzip compression that is the same as deflate with some extra header information (see rfc 1952). |
| Constructor Summary | |
|---|---|
GZipInputStream(InputStream inputStream,
int compressionType,
boolean hash)
Creates an input stream capable of GZIP and Deflate with a buffer of 1024 bytes. |
|
GZipInputStream(InputStream inputStream,
int size,
int compressionType,
boolean hash)
Creates an input stream capable of GZIP and Deflate. |
|
| Method Summary | |
|---|---|
int |
available()
This function fills the buffer and returns the amount of avialable data. |
void |
close()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long n)
|
int |
validData()
Checks if the current status is valid |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_DEFLATE
public static final int TYPE_GZIP
| Constructor Detail |
|---|
public GZipInputStream(InputStream inputStream,
int compressionType,
boolean hash)
throws IOException
inputStream - the stream that contains the compressed data.compressionType - TYPE_GZIP or TYPE_DEFLATEhash - set true for data checking, set false for speed reading
IOException - when the header of a GZIP stream cannot be skippedTYPE_DEFLATE,
TYPE_GZIP
public GZipInputStream(InputStream inputStream,
int size,
int compressionType,
boolean hash)
throws IOException
inputStream - the stream that contains the compressed data.size - the size of the internally used buffercompressionType - TYPE_GZIP or TYPE_DEFLATEhash - set true for data checking, set false for speed reading
IOException - when the header of a GZIP stream cannot be skippedTYPE_DEFLATE,
TYPE_GZIP| Method Detail |
|---|
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException
public int validData()
throws IOException
IOException
public int available()
throws IOException
available in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] b)
throws IOException
read in class InputStreamIOException
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||