public final class CachedFileReader extends AbstractReader implements Reader
Modifier and Type | Field and Description |
---|---|
private byte[] |
cache |
private int |
cachelen |
private java.io.RandomAccessFile |
RAFile |
file, name
Constructor and Description |
---|
CachedFileReader(java.io.File file) |
Modifier and Type | Method and Description |
---|---|
long |
available() |
void |
close() |
protected void |
finalize() |
long |
length() |
void |
readFully(byte[] b,
int off,
int len) |
void |
seek(long pos) |
file, name, readFully, readInt, readLong, readShort
private final java.io.RandomAccessFile RAFile
private byte[] cache
private final int cachelen
public CachedFileReader(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public final long available() throws java.io.IOException
available
in interface Reader
available
in class AbstractReader
java.io.IOException
public final long length() throws java.io.IOException
length
in interface Reader
length
in class AbstractReader
java.io.IOException
public final void readFully(byte[] b, int off, int len) throws java.io.IOException
readFully
in interface Reader
readFully
in class AbstractReader
java.io.IOException
public final void seek(long pos) throws java.io.IOException
seek
in interface Reader
seek
in class AbstractReader
java.io.IOException
public final void close()
close
in interface Reader
close
in class AbstractReader
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable