|
TrueZIP 6.8.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.io.rof.AbstractReadOnlyFile
de.schlichtherle.io.rof.MemoryMappedReadOnlyFile
public class MemoryMappedReadOnlyFile
A ReadOnlyFile implementation using channels to map the underlying
file into memory.
This class supports files larger than Integer.MAX_VALUE.
| Field Summary | |
|---|---|
private FileChannel |
channel
Deprecated. |
private ByteBuffer |
window
Deprecated. |
private static int |
WINDOW_LEN
Deprecated. The length of the mapped window. |
private long |
windowOff
Deprecated. |
| Constructor Summary | |
|---|---|
MemoryMappedReadOnlyFile(File file)
Deprecated. |
|
| Method Summary | |
|---|---|
private int |
available()
Deprecated. Returns the number of bytes available in the floating window. |
void |
close()
Deprecated. |
private void |
ensureOpen()
Deprecated. Ensures that this file is open. |
long |
getFilePointer()
Deprecated. |
long |
length()
Deprecated. |
int |
read()
Deprecated. |
int |
read(byte[] buf,
int off,
int len)
Deprecated. Reads up to len bytes of data from this read only file into
the given array. |
void |
seek(long fp)
Deprecated. Sets the file pointer offset, measured from the beginning of this file, at which the next read occurs. |
private void |
window(long newWindowOff)
Deprecated. |
| Methods inherited from class de.schlichtherle.io.rof.AbstractReadOnlyFile |
|---|
read, readFully, readFully, skipBytes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int WINDOW_LEN
private FileChannel channel
private long windowOff
private ByteBuffer window
| Constructor Detail |
|---|
public MemoryMappedReadOnlyFile(File file)
throws FileNotFoundException
FileNotFoundException| Method Detail |
|---|
private final int available()
throws IOException
IOException
private void window(long newWindowOff)
throws IOException
IOException
public long length()
throws IOException
IOException
public long getFilePointer()
throws IOException
IOException
public void seek(long fp)
throws IOException
ReadOnlyFileSimpleReadOnlyFile subclasses
RandomAccessFile and passes "r" as a
parameter to the superclass constructor.
On the Windows platform, this implementation allows to seek past the
end of file, but on the Linux platform it doesn't.
fp - The offset position, measured in bytes from the beginning
of the file, at which to set the file pointer.
IOException - If pos is less than 0 or if
an I/O error occurs.
public int read()
throws IOException
IOException
public int read(byte[] buf,
int off,
int len)
throws IOException
ReadOnlyFilelen bytes of data from this read only file into
the given array.
This method blocks until at least one byte of input is available.
buf - The buffer to fill with data.off - The start offset of the data.len - The maximum number of bytes to read.
-1 if there is
no more data because the end of the file has been reached.
IOException - On any I/O related issue.
public void close()
throws IOException
IOException
private final void ensureOpen()
throws IOException
IOException - If the preconditions do not hold.
|
TrueZIP 6.8.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||