public class MappedRandomAccessFile
extends java.lang.Object
MappedByteBuffer wrapped as a RandomAccessFile| Constructor | Description |
|---|---|
MappedRandomAccessFile(java.lang.String filename,
java.lang.String mode) |
Constructs a new MappedRandomAccessFile instance
|
| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
clean(java.nio.ByteBuffer buffer) |
invokes the clean method on the ByteBuffer's cleaner
|
void |
close() |
|
protected void |
finalize() |
invokes the close method
|
java.nio.channels.FileChannel |
getChannel() |
|
long |
getFilePointer() |
|
long |
length() |
|
int |
read() |
|
int |
read(byte[] bytes,
int off,
int len) |
|
void |
seek(long pos) |
public MappedRandomAccessFile(java.lang.String filename,
java.lang.String mode)
throws java.io.FileNotFoundException,
java.io.IOException
filename - Stringmode - String r, w or rwjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic java.nio.channels.FileChannel getChannel()
public int read()
RandomAccessFile.read()public int read(byte[] bytes,
int off,
int len)
bytes - byte[]off - int offsetlen - int lengthRandomAccessFile.read(byte[], int, int)public long getFilePointer()
RandomAccessFile.getFilePointer()public void seek(long pos)
pos - long positionRandomAccessFile.seek(long)public long length()
RandomAccessFile.length()public void close()
throws java.io.IOException
java.io.IOExceptionCleans the mapped bytebuffer and closes the channelprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.ThrowableObject.finalize()public static boolean clean(java.nio.ByteBuffer buffer)
buffer - ByteBufferCopyright © 1998–2018. All rights reserved.