|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.ning.compress.lzf.LZFInputStream
public class LZFInputStream
Field Summary | |
---|---|
protected boolean |
_cfgFullReads
Flag that indicates whether we force full reads (reading of as many bytes as requested), or 'optimal' reads (up to as many as available, but at least one). |
protected InputStream |
inputStream
stream to be decompressed |
protected boolean |
inputStreamClosed
Flag that indicates if we have already called 'inputStream.close()' (to avoid calling it multiple times) |
Constructor Summary | |
---|---|
LZFInputStream(InputStream inputStream)
|
|
LZFInputStream(InputStream in,
boolean fullReads)
|
Method Summary | |
---|---|
int |
available()
Method is overridden to report number of bytes that can now be read from decoded data buffer, without reading bytes from the underlying stream. |
void |
close()
|
void |
discardBuffered()
Method that can be called to discard any already buffered input, read from input source. |
InputStream |
getUnderlyingInputStream()
Method that can be used to find underlying InputStream that
we read from to get LZF encoded data to decode. |
int |
read()
|
int |
read(byte[] buffer)
|
int |
read(byte[] buffer,
int offset,
int length)
|
protected boolean |
readyBuffer()
Fill the uncompressed bytes buffer by reading the underlying inputStream. |
void |
setUseFullReads(boolean b)
Method that can be used define whether reads should be "full" or "optimal": former means that full compressed blocks are read right away as needed, optimal that only smaller chunks are read at a time, more being read as needed. |
long |
skip(long n)
Overridden to just skip at most a single chunk at a time |
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 |
---|
protected final InputStream inputStream
protected boolean inputStreamClosed
protected boolean _cfgFullReads
Constructor Detail |
---|
public LZFInputStream(InputStream inputStream) throws IOException
IOException
public LZFInputStream(InputStream in, boolean fullReads) throws IOException
in
- Underlying input stream to usefullReads
- Whether read(byte[])
should try to read exactly
as many bytes as requested (true); or just however many happen to be
available (false)
IOException
Method Detail |
---|
public void setUseFullReads(boolean b)
public int available()
available
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] buffer) throws IOException
read
in class InputStream
IOException
public int read(byte[] buffer, int offset, int length) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public InputStream getUnderlyingInputStream()
InputStream
that
we read from to get LZF encoded data to decode.
Will never return null; although underlying stream may be closed
(if this stream has been closed).
public void discardBuffered()
InputStream
can be repositioned reliably.
protected boolean readyBuffer() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |