- java.lang.Object
-
- com.itextpdf.text.pdf.MappedRandomAccessFile
-
public class MappedRandomAccessFile extends java.lang.ObjectAMappedByteBufferwrapped as aRandomAccessFile- Author:
- Joakim Sandstroem Created on 6.9.2006
-
-
Constructor Summary
Constructors Constructor Description MappedRandomAccessFile(java.lang.String filename, java.lang.String mode)Constructs a new MappedRandomAccessFile instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanclean(java.nio.ByteBuffer buffer)invokes the clean method on the ByteBuffer's cleanervoidclose()protected voidfinalize()invokes the close methodjava.nio.channels.FileChannelgetChannel()longgetFilePointer()longlength()intread()intread(byte[] bytes, int off, int len)voidseek(long pos)
-
-
-
Constructor Detail
-
MappedRandomAccessFile
public MappedRandomAccessFile(java.lang.String filename, java.lang.String mode) throws java.io.FileNotFoundException, java.io.IOExceptionConstructs a new MappedRandomAccessFile instance- Parameters:
filename- Stringmode- String r, w or rw- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
-
Method Detail
-
getChannel
public java.nio.channels.FileChannel getChannel()
- Since:
- 2.0.8
-
read
public int read()
- Returns:
- int next integer or -1 on EOF
- See Also:
RandomAccessFile.read()
-
read
public int read(byte[] bytes, int off, int len)- Parameters:
bytes- byte[]off- int offsetlen- int length- Returns:
- int bytes read or -1 on EOF
- See Also:
RandomAccessFile.read(byte[], int, int)
-
getFilePointer
public long getFilePointer()
- Returns:
- long
- See Also:
RandomAccessFile.getFilePointer()
-
seek
public void seek(long pos)
- Parameters:
pos- long position- See Also:
RandomAccessFile.seek(long)
-
length
public long length()
- Returns:
- long length
- See Also:
RandomAccessFile.length()
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException- See Also:
Cleans the mapped bytebuffer and closes the channel
-
finalize
protected void finalize() throws java.lang.Throwableinvokes the close method- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- See Also:
Object.finalize()
-
clean
public static boolean clean(java.nio.ByteBuffer buffer)
invokes the clean method on the ByteBuffer's cleaner- Parameters:
buffer- ByteBuffer- Returns:
- boolean true on success
-
-