public class MMapRandomAccessFile extends RandomAccessFile
allFiles, BIG_ENDIAN, bigEndian, buffer, bufferStart, dataEnd, dataSize, debugAccess, debugLeaks, defaultBufferSize, endOfFile, file, fileChannel, filePosition, LITTLE_ENDIAN, location, openFiles, readonly, showOpen, showRead| Constructor and Description |
|---|
MMapRandomAccessFile(java.lang.String location,
java.lang.String mode)
Constructor for in-memory "files"
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Copy the contents of the buffer to the disk.
|
long |
length()
Get the length of the file.
|
int |
read()
Read a byte of data from the file, blocking until data is
available.
|
protected int |
readBytes(byte[] dst,
int offset,
int length)
Read up to
len bytes into an array, at a specified
offset. |
void |
seek(long pos)
Set the position in the file for the next read or write.
|
void |
unread()
Unread the last byte read.
|
void |
write(int b)
Write a byte to the file.
|
void |
writeBytes(byte[] dst,
int offset,
int length)
Write
len bytes from an array to the file. |
acquire, acquire, close, eject, enableDefaultGlobalFileCache, getAllFiles, getBufferSize, getDebugLeaks, getDebugNbytes, getDebugNseeks, getFilePointer, getGlobalFileCache, getLastModified, getLocation, getMaxOpenFileCount, getOpenFileCount, getOpenFiles, getRandomAccessFile, isAtEndOfFile, order, order, reacquire, read_, read, read, readBoolean, readBuffer, readByte, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLong, readLong, readShort, readShort, readString, readStringMax, readToByteChannel, readUnsignedByte, readUnsignedShort, readUTF, release, searchForward, setBufferSize, setDebugAccess, setDebugLeaks, setExtendMode, setFileCache, setGlobalFileCache, setMinLength, shutdown, skipBytes, skipBytes, toString, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChar, writeChars, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLong, writeLong, writeShort, writeShort, writeUTFpublic MMapRandomAccessFile(java.lang.String location,
java.lang.String mode)
throws java.io.IOException
location - used as a namemode - the open modejava.io.IOException - on errorpublic void flush()
throws java.io.IOException
RandomAccessFileflush in class RandomAccessFilejava.io.IOException - if an I/O error occurs.public long length()
RandomAccessFilelength in class RandomAccessFilepublic void seek(long pos)
RandomAccessFileseek in class RandomAccessFilepos - the offset (in bytes) from the start of the file.public void unread()
RandomAccessFileunread in class RandomAccessFilepublic int read()
throws java.io.IOException
RandomAccessFileread in class RandomAccessFilejava.io.IOException - if an I/O error occurrs.protected int readBytes(byte[] dst,
int offset,
int length)
throws java.io.IOException
RandomAccessFilelen bytes into an array, at a specified
offset. This will block until at least one byte has been read.readBytes in class RandomAccessFiledst - the byte array to receive the bytes.offset - the offset in the array where copying will start.length - the number of bytes to copy.java.io.IOException - if an I/O error occurrs.public void write(int b)
throws java.io.IOException
RandomAccessFilewrite in interface java.io.DataOutputwrite in class RandomAccessFileb - write this bytejava.io.IOException - if an I/O error occurrs.public void writeBytes(byte[] dst,
int offset,
int length)
throws java.io.IOException
RandomAccessFilelen bytes from an array to the file.writeBytes in class RandomAccessFiledst - the array containing the data.offset - the offset in the array to the data.length - the length of the data.java.io.IOException - if an I/O error occurrs.