public class MemoryMappedFile
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
byte |
getByte(long pos)
Reads a byte from the specified position.
|
void |
getBytes(long pos,
byte[] data,
int offset,
int length)
Reads a buffer of data.
|
int |
getInt(long pos)
Reads an int from the specified position.
|
long |
getLong(long pos)
Reads a long from the specified position.
|
void |
putByte(long pos,
byte val)
Writes a byte to the specified position.
|
void |
putInt(long pos,
int val)
Writes an int to the specified position.
|
void |
putLong(long pos,
long val)
Writes a long to the specified position.
|
void |
setBytes(long pos,
byte[] data,
int offset,
int length)
Writes a buffer of data.
|
public byte getByte(long pos)
pos - the position in the memory mapped filepublic int getInt(long pos)
pos - the position in the memory mapped filepublic long getLong(long pos)
pos - position in the memory mapped filepublic void putByte(long pos,
byte val)
pos - the position in the memory mapped fileval - the value to writepublic void putInt(long pos,
int val)
pos - the position in the memory mapped fileval - the value to writepublic void putLong(long pos,
long val)
pos - the position in the memory mapped fileval - the value to writepublic void getBytes(long pos,
byte[] data,
int offset,
int length)
pos - the position in the memory mapped filedata - the input bufferoffset - the offset in the buffer of the first byte to read data intolength - the length of the datapublic void setBytes(long pos,
byte[] data,
int offset,
int length)
pos - the position in the memory mapped filedata - the output bufferoffset - the offset in the buffer of the first byte to writelength - the length of the data