Package org.geotools.io
Class MemoryMappedRandomAccessFile
- Object
-
- RandomAccessFile
-
- MemoryMappedRandomAccessFile
-
- All Implemented Interfaces:
Closeable
,DataInput
,DataOutput
,AutoCloseable
,FileCacheable
public class MemoryMappedRandomAccessFile extends RandomAccessFile
A ReadOnly MemoryMapped RandomAccessFile. It will map the file in memory, using a MappedByteBuffer.Writing capability is not supported at the moment.
-
-
Constructor Summary
Constructors Constructor Description MemoryMappedRandomAccessFile(String location, String mode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static String
getUriString(String uriString)
long
length()
void
reacquire()
int
read()
int
readBytes(byte[] dst, int offset, int length)
void
release()
boolean
searchForward(KMPMatch match, int maxBytes)
void
seek(long pos)
void
setFileCache(FileCacheIF fileCache)
void
write(int b)
void
writeBytes(byte[] dst, int offset, int length)
-
Methods inherited from class RandomAccessFile
acquire, acquire, eject, enableDefaultGlobalFileCache, flush, getAllFiles, getBufferSize, getDebugLeaks, getDebugNbytes, getDebugNseeks, getFilePointer, getGlobalFileCache, getLastModified, getLocation, getMaxOpenFileCount, getOpenFileCount, getOpenFiles, getRandomAccessFile, isAtEndOfFile, isDirectory, order, order, read, read, read_, readBoolean, readBuffer, readByte, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLine, readLong, readLong, readShort, readShort, readString, readString, readStringMax, readStringMax, readToByteChannel, readUnsignedByte, readUnsignedShort, readUTF, setBufferSize, setDebugAccess, setDebugLeaks, setExtendMode, setGlobalFileCache, setMinLength, shutdown, skipBytes, skipBytes, toString, unread, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChar, writeChar, writeChar, writeChar, writeChar, writeChars, writeChars, writeChars, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeInt, writeInt, writeInt, writeInt, writeInt, writeInt, writeLong, writeLong, writeLong, writeLong, writeLong, writeLong, writeShort, writeShort, writeShort, writeShort, writeShort, writeShort, writeUTF
-
-
-
-
Constructor Detail
-
MemoryMappedRandomAccessFile
public MemoryMappedRandomAccessFile(String location, String mode) throws IOException
- Throws:
IOException
-
-
Method Detail
-
seek
public void seek(long pos) throws IOException
- Overrides:
seek
in classRandomAccessFile
- Throws:
IOException
-
release
public void release()
- Specified by:
release
in interfaceFileCacheable
- Overrides:
release
in classRandomAccessFile
-
reacquire
public void reacquire()
- Specified by:
reacquire
in interfaceFileCacheable
- Overrides:
reacquire
in classRandomAccessFile
-
setFileCache
public void setFileCache(FileCacheIF fileCache)
- Specified by:
setFileCache
in interfaceFileCacheable
- Overrides:
setFileCache
in classRandomAccessFile
-
read
public int read() throws IOException
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
readBytes
public int readBytes(byte[] dst, int offset, int length) throws IOException
- Overrides:
readBytes
in classRandomAccessFile
- Throws:
IOException
-
write
public void write(int b)
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
-
writeBytes
public void writeBytes(byte[] dst, int offset, int length)
- Overrides:
writeBytes
in classRandomAccessFile
-
length
public long length()
- Overrides:
length
in classRandomAccessFile
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFileCacheable
- Overrides:
close
in classRandomAccessFile
- Throws:
IOException
-
searchForward
public boolean searchForward(KMPMatch match, int maxBytes) throws IOException
- Overrides:
searchForward
in classRandomAccessFile
- Throws:
IOException
-
-