Buffer

Undocumented in source.

Constructors

this
this(int mark, int pos, int lim, int cap)
Undocumented in source.

Members

Functions

arrayOffset
int arrayOffset()

Returns the offset within this buffer's backing array of the first element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>.

capacity
int capacity()

Returns this buffer's capacity.

checkIndex
int checkIndex(int i)

Checks the given index against the limit, throwing an {@link IndexOutOfBoundsException} if it is not smaller than the limit or is smaller than zero.

checkIndex
int checkIndex(int i, int nb)
Undocumented in source. Be warned that the author may not have intended to support it.
clear
Buffer clear()

Clears this buffer. The position is set to zero, the limit is set to the capacity, and the mark is discarded.

discardMark
void discardMark()
Undocumented in source. Be warned that the author may not have intended to support it.
flip
Buffer flip()

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.

hasArray
bool hasArray()

Tells whether or not this buffer is backed by an accessible array.

hasRemaining
bool hasRemaining()

Tells whether there are any elements between the current position and the limit.

isDirect
bool isDirect()

Tells whether or not this buffer is <a href="ByteBuffer.html#direct"><i>direct</i></a>.

isReadOnly
bool isReadOnly()

Tells whether or not this buffer is read-only.

limit
int limit()

Returns this buffer's limit.

limit
Buffer limit(int newLimit)

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.

mark
Buffer mark()

Sets this buffer's mark at its position.

markValue
int markValue()
Undocumented in source. Be warned that the author may not have intended to support it.
nextGetIndex
int nextGetIndex()

Checks the current position against the limit, throwing a {@link BufferUnderflowException} if it is not smaller than the limit, and then increments the position.

nextGetIndex
int nextGetIndex(int nb)
Undocumented in source. Be warned that the author may not have intended to support it.
nextPutIndex
int nextPutIndex()

Checks the current position against the limit, throwing a {@link BufferOverflowException} if it is not smaller than the limit, and then increments the position.

nextPutIndex
int nextPutIndex(int nb)
Undocumented in source. Be warned that the author may not have intended to support it.
position
int position()

Returns this buffer's position.

position
Buffer position(int newPosition)

Sets this buffer's position. If the mark is defined and larger than the new position then it is discarded.

remaining
int remaining()

Returns the number of elements between the current position and the limit.

reset
Buffer reset()

Resets this buffer's position to the previously-marked position.

rewind
Buffer rewind()

Rewinds this buffer. The position is set to zero and the mark is discarded.

truncate
void truncate()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

checkBounds
void checkBounds(int off, int len, int size)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta