public class LZFFileInputStream extends FileInputStream
FileInputStream.
Note that use of this class is not recommended unless you absolutely must
use a FileInputStream instance; otherwise basic LZFInputStream
(which uses aggregation for underlying streams) is more appropriate
Implementation note: much of the code is just copied from LZFInputStream,
so care must be taken to keep implementations in sync if there are fixes.
| Modifier and Type | Field and Description |
|---|---|
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 boolean |
_inputStreamClosed
Flag that indicates if we have already called 'inputStream.close()'
(to avoid calling it multiple times)
|
| Constructor and Description |
|---|
LZFFileInputStream(File file) |
LZFFileInputStream(File file,
ChunkDecoder decompressor) |
LZFFileInputStream(FileDescriptor fdObj) |
LZFFileInputStream(FileDescriptor fdObj,
ChunkDecoder decompressor) |
LZFFileInputStream(String name) |
LZFFileInputStream(String name,
ChunkDecoder decompressor) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] buffer,
int offset,
int length) |
protected int |
readRaw(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
|
finalize, getChannel, getFDmark, markSupported, resetprotected boolean _inputStreamClosed
protected boolean _cfgFullReads
public LZFFileInputStream(File file) throws FileNotFoundException
FileNotFoundExceptionpublic LZFFileInputStream(FileDescriptor fdObj)
public LZFFileInputStream(String name) throws FileNotFoundException
FileNotFoundExceptionpublic LZFFileInputStream(File file, ChunkDecoder decompressor) throws FileNotFoundException
FileNotFoundExceptionpublic LZFFileInputStream(FileDescriptor fdObj, ChunkDecoder decompressor)
public LZFFileInputStream(String name, ChunkDecoder decompressor) throws FileNotFoundException
FileNotFoundExceptionpublic void setUseFullReads(boolean b)
public int available()
available in class FileInputStreampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FileInputStreamIOExceptionpublic int read()
throws IOException
read in class FileInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class FileInputStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws IOException
read in class FileInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class FileInputStreamIOExceptionprotected boolean readyBuffer()
throws IOException
IOExceptionprotected final int readRaw(byte[] buffer,
int offset,
int length)
throws IOException
IOExceptionCopyright © 2013. All Rights Reserved.