java.nio
public
abstract
class
java.nio.MappedByteBuffer
MappedByteBuffer
is a special kind of direct byte buffer,
which maps a region of file to memory.
MappedByteBuffer
can be created by calling
FileChannel.map.
Once created, the mapping between the byte buffer and the file region remains
valid until the byte buffer is garbage collected.
All or part of a MappedByteBuffer
's content may change or
become inaccessible at any time, since the mapped file region can be modified
by another thread or process at any time. If this happens, the behavior of
the MappedByteBuffer
is undefined.
Summary
Public Methods
allocate,
allocateDirect,
array,
arrayOffset,
asCharBuffer,
asDoubleBuffer,
asFloatBuffer,
asIntBuffer,
asLongBuffer,
asReadOnlyBuffer,
asShortBuffer,
compact,
compareTo,
duplicate,
equals,
get,
get,
get,
get,
getChar,
getChar,
getDouble,
getDouble,
getFloat,
getFloat,
getInt,
getInt,
getLong,
getLong,
getShort,
getShort,
hasArray,
hashCode,
isDirect,
order,
order,
put,
put,
put,
put,
put,
putChar,
putChar,
putDouble,
putDouble,
putFloat,
putFloat,
putInt,
putInt,
putLong,
putLong,
putShort,
putShort,
slice,
toString,
wrap,
wrap
|
|
|
static |
|
ByteBuffer |
allocate(int capacity) |
|
|
|
static |
|
ByteBuffer |
allocateDirect(int capacity) |
|
|
final |
|
|
byte[] |
array() |
|
|
final |
|
|
int |
arrayOffset() |
abstract |
|
|
|
|
CharBuffer |
asCharBuffer() |
abstract |
|
|
|
|
DoubleBuffer |
asDoubleBuffer() |
abstract |
|
|
|
|
FloatBuffer |
asFloatBuffer() |
abstract |
|
|
|
|
IntBuffer |
asIntBuffer() |
abstract |
|
|
|
|
LongBuffer |
asLongBuffer() |
abstract |
|
|
|
|
ByteBuffer |
asReadOnlyBuffer() |
abstract |
|
|
|
|
ShortBuffer |
asShortBuffer() |
abstract |
|
|
|
|
ByteBuffer |
compact() |
|
|
|
|
|
int |
compareTo(ByteBuffer otherBuffer) |
abstract |
|
|
|
|
ByteBuffer |
duplicate() |
|
|
|
|
|
boolean |
equals(Object other) |
abstract |
|
|
|
|
byte |
get() |
|
|
|
|
|
ByteBuffer |
get(byte[] dest, int off, int len) |
|
|
|
|
|
ByteBuffer |
get(byte[] dest) |
abstract |
|
|
|
|
byte |
get(int index) |
abstract |
|
|
|
|
char |
getChar(int index) |
abstract |
|
|
|
|
char |
getChar() |
abstract |
|
|
|
|
double |
getDouble() |
abstract |
|
|
|
|
double |
getDouble(int index) |
abstract |
|
|
|
|
float |
getFloat() |
abstract |
|
|
|
|
float |
getFloat(int index) |
abstract |
|
|
|
|
int |
getInt(int index) |
abstract |
|
|
|
|
int |
getInt() |
abstract |
|
|
|
|
long |
getLong() |
abstract |
|
|
|
|
long |
getLong(int index) |
abstract |
|
|
|
|
short |
getShort(int index) |
abstract |
|
|
|
|
short |
getShort() |
|
|
final |
|
|
boolean |
hasArray() |
|
|
|
|
|
int |
hashCode() |
abstract |
|
|
|
|
boolean |
isDirect() |
|
|
final |
|
|
ByteOrder |
order() |
|
|
final |
|
|
ByteBuffer |
order(ByteOrder byteOrder) |
|
|
final |
|
|
ByteBuffer |
put(byte[] src) |
abstract |
|
|
|
|
ByteBuffer |
put(byte b) |
abstract |
|
|
|
|
ByteBuffer |
put(int index, byte b) |
|
|
|
|
|
ByteBuffer |
put(ByteBuffer src) |
|
|
|
|
|
ByteBuffer |
put(byte[] src, int off, int len) |
abstract |
|
|
|
|
ByteBuffer |
putChar(int index, char value) |
abstract |
|
|
|
|
ByteBuffer |
putChar(char value) |
abstract |
|
|
|
|
ByteBuffer |
putDouble(int index, double value) |
abstract |
|
|
|
|
ByteBuffer |
putDouble(double value) |
abstract |
|
|
|
|
ByteBuffer |
putFloat(int index, float value) |
abstract |
|
|
|
|
ByteBuffer |
putFloat(float value) |
abstract |
|
|
|
|
ByteBuffer |
putInt(int value) |
abstract |
|
|
|
|
ByteBuffer |
putInt(int index, int value) |
abstract |
|
|
|
|
ByteBuffer |
putLong(long value) |
abstract |
|
|
|
|
ByteBuffer |
putLong(int index, long value) |
abstract |
|
|
|
|
ByteBuffer |
putShort(int index, short value) |
abstract |
|
|
|
|
ByteBuffer |
putShort(short value) |
abstract |
|
|
|
|
ByteBuffer |
slice() |
|
|
|
|
|
String |
toString() |
|
|
|
static |
|
ByteBuffer |
wrap(byte[] array) |
|
|
|
static |
|
ByteBuffer |
wrap(byte[] array, int start, int len) |
capacity,
clear,
flip,
hasRemaining,
isReadOnly,
limit,
limit,
mark,
position,
position,
remaining,
reset,
rewind
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
Writes all changes of the buffer to the mapped file.
All changes must be written by invoking this method if the mapped file
exists on the local device, otherwise the action can not be specified.
public
final
boolean
isLoaded()
Returns true if this buffer's content is loaded.
Returns
- True if this buffer's content is loaded.
Loads this buffer's content into memory.