CharBuffer (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Appendable, CharSequence, Comparable<CharBuffer>, Readable
-
Method Summary
allocate(int capacity) Allocates a new char buffer.
append(char c) Appends the specified char to this buffer (optional operation).
Appends the specified character sequence to this buffer (optional operation).
Appends a subsequence of the specified character sequence to this buffer (optional operation).
final char[]array()Returns the char array that backs this buffer (optional operation).
final intReturns the offset within this buffer's backing array of the first element of the buffer (optional operation).
Creates a new, read-only char buffer that shares this buffer's content.
final charcharAt(int index) Reads the character at the given index relative to the current position.
clear()compact()Compacts this buffer (optional operation).
intCompares this buffer to another.
Creates a new char buffer that shares this buffer's content.
booleanTells whether or not this buffer is equal to another object.
flip()abstract charget()get(char[] dst) Relative bulk get method.
get(char[] dst, int offset, int length) Relative bulk get method.
abstract charget(int index) get(int index, char[] dst) Absolute bulk get method.
get(int index, char[] dst, int offset, int length) Absolute bulk get method.
voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Relative bulk get method.
final booleanhasArray()Tells whether or not this buffer is backed by an accessible char array.
inthashCode()Returns the current hash code of this buffer.
abstract booleanisDirect()Tells whether or not this char buffer is direct.
final booleanisEmpty()Returns
trueif this character buffer is empty.final intlength()Returns the length of this character buffer.
limit(int newLimit) Sets this buffer's limit.
mark()Sets this buffer's mark at its position.
intFinds and returns the relative index of the first mismatch between this buffer and a given buffer.
order()Retrieves this buffer's byte order.
position(int newPosition) Sets this buffer's position.
put(char c) Relative put method (optional operation).
put(char[] src) Relative bulk put method (optional operation).
put(char[] src, int offset, int length) Relative bulk put method (optional operation).
put(int index, char c) Absolute put method (optional operation).
put(int index, char[] src) Absolute bulk put method (optional operation).
put(int index, char[] src, int offset, int length) Absolute bulk put method (optional operation).
put(int index, CharBuffer src, int offset, int length) Absolute bulk put method (optional operation).
Relative bulk put method (optional operation).
put(String src, int start, int end) Relative bulk put method (optional operation).
Relative bulk put method (optional operation).
intAttempts to read characters into the specified character buffer.
reset()Resets this buffer's position to the previously-marked position.
rewind()slice()Creates a new char buffer whose content is a shared subsequence of this buffer's content.
slice(int index, int length) Creates a new char buffer whose content is a shared subsequence of this buffer's content.
subSequence(int start, int end) Creates a new character buffer that represents the specified subsequence of this buffer, relative to the current position.
toString()Returns a string containing the characters in this buffer.
wrap(char[] array) Wraps a char array into a buffer.
wrap(char[] array, int offset, int length) Wraps a char array into a buffer.
Wraps a character sequence into a buffer.
Wraps a character sequence into a buffer.
-
Method Details
-
allocate
-
wrap
-
wrap
-
read
-
wrap
-
wrap
-
slice
-
slice
-
duplicate
-
asReadOnlyBuffer
-
get
-
put
-
get
-
put
-
get
-
get
-
get
-
get
-
put
-
put
-
put
-
put
-
put
-
put
-
put
-
put
-
hasArray
-
array
-
arrayOffset
-
position
-
limit
-
mark
-
reset
-
clear
-
flip
-
rewind
-
compact
-
isDirect
-
hashCode
-
equals
-
compareTo
-
mismatch
-
getChars
-
toString
-
length
-
isEmpty
-
charAt
-
subSequence
-
append
-
append
-
append
-
order
-