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, getFD
mark, markSupported, reset
protected boolean _inputStreamClosed
protected boolean _cfgFullReads
public LZFFileInputStream(File file) throws FileNotFoundException
FileNotFoundException
public LZFFileInputStream(FileDescriptor fdObj)
public LZFFileInputStream(String name) throws FileNotFoundException
FileNotFoundException
public LZFFileInputStream(File file, ChunkDecoder decompressor) throws FileNotFoundException
FileNotFoundException
public LZFFileInputStream(FileDescriptor fdObj, ChunkDecoder decompressor)
public LZFFileInputStream(String name, ChunkDecoder decompressor) throws FileNotFoundException
FileNotFoundException
public void setUseFullReads(boolean b)
public int available()
available
in class FileInputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FileInputStream
IOException
public int read() throws IOException
read
in class FileInputStream
IOException
public int read(byte[] b) throws IOException
read
in class FileInputStream
IOException
public int read(byte[] buffer, int offset, int length) throws IOException
read
in class FileInputStream
IOException
public long skip(long n) throws IOException
skip
in class FileInputStream
IOException
protected boolean readyBuffer() throws IOException
IOException
protected final int readRaw(byte[] buffer, int offset, int length) throws IOException
IOException
Copyright © 2013. All Rights Reserved.