|
TrueZIP 6.8 | |||||||||
| 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.
| Constructor Summary | |
|---|---|
MemoryMappedReadOnlyFile(File file)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
close()
Deprecated. |
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. |
| 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 |
| Constructor Detail |
|---|
public MemoryMappedReadOnlyFile(File file)
throws FileNotFoundException
FileNotFoundException| Method Detail |
|---|
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
|
TrueZIP 6.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||