Buffer (Java SE 23 & JDK 23)
-
Method Summary
array()Returns the array that backs this buffer (optional operation).
abstract intReturns the offset within this buffer's backing array of the first element of the buffer (optional operation).
final intcapacity()Returns this buffer's capacity.
clear()Creates a new buffer that shares this buffer's content.
flip()abstract booleanhasArray()Tells whether or not this buffer is backed by an accessible array.
final booleanTells whether there are any elements between the current position and the limit.
abstract booleanisDirect()Tells whether or not this buffer is direct.
abstract booleanTells whether or not this buffer is read-only.
final intlimit()Returns this buffer's limit.
limit(int newLimit) Sets this buffer's limit.
mark()Sets this buffer's mark at its position.
final intposition()Returns this buffer's position.
position(int newPosition) Sets this buffer's position.
final intReturns the number of elements between the current position and the limit.
reset()Resets this buffer's position to the previously-marked position.
rewind()slice()Creates a new buffer whose content is a shared subsequence of this buffer's content.
slice(int index, int length) Creates a new buffer whose content is a shared subsequence of this buffer's content.
-
Method Details
-
capacity
-
position
-
position
-
limit
-
limit
-
mark
-
reset
-
clear
-
flip
-
rewind
-
remaining
-
hasRemaining
-
isReadOnly
-
hasArray
-
array
-
arrayOffset
-
isDirect
-
slice
-
slice
-
duplicate
-