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.
-
Field Summary
Fields inherited from class RandomAccessFile
allFiles, BIG_ENDIAN, bigEndian, buffer, bufferModified, bufferStart, dataEnd, dataSize, debugAccess, debugLeaks, defaultBufferSize, endOfFile, file, fileChannel, filePosition, LITTLE_ENDIAN, location, openFiles, readonly, showOpen, showRead
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static String
getUriString
(String uriString) long
length()
void
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 Details
-
MemoryMappedRandomAccessFile
- Throws:
IOException
-
-
Method Details
-
seek
- 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
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
readBytes
- 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
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFileCacheable
- Overrides:
close
in classRandomAccessFile
- Throws:
IOException
-
getUriString
-
searchForward
- Overrides:
searchForward
in classRandomAccessFile
- Throws:
IOException
-