public class DeflateCompressorInputStream extends CompressorInputStream implements InputStreamStatistics
Modifier and Type | Field and Description |
---|---|
private CountingInputStream |
countingStream |
private java.io.InputStream |
in |
private java.util.zip.Inflater |
inflater |
private static int |
MAGIC_1 |
private static int |
MAGIC_2a |
private static int |
MAGIC_2b |
private static int |
MAGIC_2c |
private static int |
MAGIC_2d |
Constructor and Description |
---|
DeflateCompressorInputStream(java.io.InputStream inputStream)
Creates a new input stream that decompresses Deflate-compressed data
from the specified input stream.
|
DeflateCompressorInputStream(java.io.InputStream inputStream,
DeflateParameters parameters)
Creates a new input stream that decompresses Deflate-compressed data
from the specified input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getCompressedCount() |
static boolean |
matches(byte[] signature,
int length)
Checks if the signature matches what is expected for a zlib / deflated file
with the zlib header.
|
int |
read() |
int |
read(byte[] buf,
int off,
int len) |
long |
skip(long n) |
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUncompressedCount
private static final int MAGIC_1
private static final int MAGIC_2a
private static final int MAGIC_2b
private static final int MAGIC_2c
private static final int MAGIC_2d
private final CountingInputStream countingStream
private final java.io.InputStream in
private final java.util.zip.Inflater inflater
public DeflateCompressorInputStream(java.io.InputStream inputStream)
inputStream
- where to read the compressed datapublic DeflateCompressorInputStream(java.io.InputStream inputStream, DeflateParameters parameters)
inputStream
- where to read the compressed dataparameters
- parameterspublic int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] buf, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public long getCompressedCount()
getCompressedCount
in interface InputStreamStatistics
public static boolean matches(byte[] signature, int length)
signature
- the bytes to checklength
- the number of bytes to check