com.lowagie.text.pdf
public class MappedRandomAccessFile extends Object
Field Summary | |
---|---|
FileChannel | channel |
MappedByteBuffer | mappedByteBuffer |
Constructor Summary | |
---|---|
MappedRandomAccessFile(String filename, String mode)
Constructs a new MappedRandomAccessFile instance |
Method Summary | |
---|---|
static boolean | clean(ByteBuffer buffer)
invokes the clean method on the ByteBuffer's cleaner |
void | close() |
protected void | finalize()
invokes the close method |
long | getFilePointer() |
void | init(FileChannel channel, MapMode mapMode)
initializes the channel and mapped bytebuffer |
long | length() |
int | read() |
int | read(byte[] bytes, int off, int len) |
void | seek(long pos) |
Parameters: filename String mode String r, w or rw
Throws: FileNotFoundException IOException
Parameters: buffer ByteBuffer
Returns: boolean true on success
See Also: java.io.RandomAccessFile#close()
Cleans the mapped bytebuffer and closes the channel
See Also: java.lang.Object#finalize()
Returns: long
See Also: java.io.RandomAccessFile#getFilePointer()
Parameters: channel FileChannel mapMode FileChannel.MapMode
Throws: IOException
Returns: long length
See Also: java.io.RandomAccessFile#length()
Returns: int next integer or -1 on EOF
See Also: java.io.RandomAccessFile#read()
Parameters: bytes byte[] off int offset len int length
Returns: int bytes read or -1 on EOF
See Also: java.io.RandomAccessFile#read(byte[], int, int)
Parameters: pos long position
See Also: java.io.RandomAccessFile#seek(long)