@Override
public final MappedByteBuffer clear ()
Overriding: java.nio.ByteBuffer
Clears this buffer. The position is set to zero, the limit is set to
the capacity, and the mark is discarded.
Invoke this method before using a sequence of channel-read or
put operations to fill this buffer. For example:
buf.clear(); // Prepare buffer for reading
in.read(buf); // Read data
This method does not actually erase the data in the buffer, but it
is named as if it did because it will most often be used in situations
in which that might as well be the case.
Returns: This buffer
@Override
public final MappedByteBuffer flip ()
Overriding: java.nio.ByteBuffer
Flips this buffer. The limit is set to the current position and then
the position is set to zero. If the mark is defined then it is
discarded.
After a sequence of channel-read or put operations, invoke
this method to prepare for a sequence of channel-write or relative
get operations. For example:
buf.put(magic); // Prepend header
in.read(buf); // Read data into rest of buffer
buf.flip(); // Flip buffer
out.write(buf); // Write header + data to channel
This method is often used in conjunction with the compact method when transferring data from
one place to another.
Returns: This buffer
@Override public final
MappedByteBuffer limit (
int newLimit)
Overriding: java.nio.ByteBuffer
Sets this buffer's limit. If the position is larger than the new limit
then it is set to the new limit. If the mark is defined and larger than
the new limit then it is discarded.
Returns: This buffer
@Override
public final MappedByteBuffer mark ()
@Override public final
MappedByteBuffer position (
int newPosition)
Overriding: java.nio.ByteBuffer
Sets this buffer's position. If the mark is defined and larger than the
new position then it is discarded.
Returns: This buffer
@Override
public final MappedByteBuffer reset ()
Overriding: java.nio.ByteBuffer
Resets this buffer's position to the previously-marked position.
Invoking this method neither changes nor discards the mark's
value.
Returns: This buffer
@Override
public final MappedByteBuffer rewind ()
Overriding: java.nio.ByteBuffer
Rewinds this buffer. The position is set to zero and the mark is
discarded.
Invoke this method before a sequence of channel-write or get
operations, assuming that the limit has already been set
appropriately. For example:
out.write(buf); // Write remaining data
buf.rewind(); // Rewind buffer
buf.get(array); // Copy data into array
Returns: This buffer