java.nio
Class Buffer
java.lang.Object
|
+--java.nio.Buffer
public abstract class
Bufferextends
Objectcap
protected int cap
Capacity of the buffer.
XXX - FIXME - should not be protected but (package) private
capacity
public final int capacity()
Retrieves the capacity of the buffer.
clear
public final Buffer clear()
Clears the buffer.
flip
public final Buffer flip()
Flips the buffer.
hasRemaining
public final boolean hasRemaining()
Tells whether the buffer has remaining data to read or not.
isReadOnly
public boolean isReadOnly()
Tells whether this buffer is read only or not.
limit
public final int limit()
Retrieves the current limit of the buffer.
limit
public final Buffer limit(int newLimit)
Sets this buffer's limit.
Parameters:
Throws:
mark
public final Buffer mark()
Sets this buffer's mark at its position.
position
public final int position()
Retrieves the current position of this buffer.
position
public final Buffer position(int newPosition)
Sets this buffer's position. If the mark is defined and larger than the
new position then it is discarded.
Parameters:
Throws:
remaining
public final int remaining()
Returns the number of elements between the current position and the limit.
reset
public final Buffer reset()
Resets this buffer's position to the previously-marked position.
Throws:
rewind
public final Buffer rewind()
Rewinds this buffer. The position is set to zero and the mark
is discarded.