Example usage for Java java.nio CharBuffer fields, constructors, methods, implement or subclass
The text is from its open source code.
CharBuffer | allocate(int capacity) Creates a char buffer based on a newly allocated char array. |
CharBuffer | append(char c) Writes the given char to the current position and increases the position by 1. |
CharBuffer | append(CharSequence csq) Writes all chars of the given character sequence csq to the current position of this buffer, and increases the position by the length of the csq. |
CharBuffer | append(CharSequence csq, int start, int end) Writes chars of the given CharSequence to the current position of this buffer, and increases the position by the number of chars written. |
char[] | array() Returns the char array which this buffer is based on, if there is one. |
int | arrayOffset() Returns the offset of the char array which this buffer is based on, if there is one. |
CharBuffer | asReadOnlyBuffer() Returns a read-only buffer that shares its content with this buffer. |
int | capacity() Returns the capacity of this buffer. |
char | charAt(int index) Returns the character located at the specified index in the buffer. |
Buffer | clear() Clears this buffer. |
CharBuffer | compact() Compacts this char buffer. |
int | compareTo(CharBuffer otherBuffer) Compare the remaining chars of this buffer to another char buffer's remaining chars. |
CharBuffer | duplicate() Returns a duplicated buffer that shares its content with this buffer. |
boolean | equals(Object other) Checks whether this char buffer is equal to another object. |
Buffer | flip() Flips this buffer. |
CharBuffer | get(char[] dest) Reads chars from the current position into the specified char array and increases the position by the number of chars read. |
char | get(int index) Returns a char at the specified index; the position is not changed. |
char | get() Returns the char at the current position and increases the position by 1. |
CharBuffer | get(char[] dest, int off, int len) Reads chars from the current position into the specified char array, starting from the specified offset, and increases the position by the number of chars read. |
boolean | hasArray() Indicates whether this buffer is based on a char array and is read/write. |
int | hashCode() Calculates this buffer's hash code from the remaining chars. |
boolean | hasRemaining() Indicates if there are elements remaining in this buffer, that is if position < limit . |
boolean | isDirect() Indicates whether this buffer is direct. |
int | length() Returns the number of remaining chars. |
int | limit() Returns the limit of this buffer. |
Buffer | limit(int newLimit) Sets the limit of this buffer. |
Buffer | mark() Marks the current position, so that the position may return to this point later by calling reset() . |
ByteOrder | order() Returns the byte order used by this buffer when converting chars from/to bytes. |
Buffer | position(int newPosition) Sets the position of this buffer. |
int | position() Returns the position of this buffer. |
CharBuffer | put(int index, char c) Writes a char to the specified index of this buffer; the position is not changed. |
CharBuffer | put(char[] src, int off, int len) Writes chars from the given char array, starting from the specified offset, to the current position and increases the position by the number of chars written. |
CharBuffer | put(String str, int start, int end) Writes chars of the given string to the current position of this buffer, and increases the position by the number of chars written. |
CharBuffer | put(char c) Writes the given char to the current position and increases the position by 1. |
CharBuffer | put(char[] src) Writes chars from the given char array to the current position and increases the position by the number of chars written. |
CharBuffer | put(CharBuffer src) Writes all the remaining chars of the src char buffer to this buffer's current position, and increases both buffers' position by the number of chars copied. |
CharBuffer | put(String str) Writes all chars of the given string to the current position of this buffer, and increases the position by the length of string. |
int | read(CharBuffer target) Reads characters from this buffer and puts them into target . |
int | remaining() Returns the number of remaining elements in this buffer, that is limit - position . |
Buffer | reset() Resets the position of this buffer to the mark . |
Buffer | rewind() Rewinds this buffer. |
CharBuffer | slice() Returns a sliced buffer that shares its content with this buffer. |
CharSequence | subSequence(int start, int end) Returns a new char buffer representing a sub-sequence of this buffer's current remaining content. |
String | toString() Returns a string representing the current remaining chars of this buffer. |
CharBuffer | wrap(char[] array, int start, int len) Creates a new char buffer by wrapping the given char array. |
CharBuffer | wrap(CharSequence chseq, int start, int end) Creates a new char buffer by wrapping the given char sequence. |
CharBuffer | wrap(char[] array) Creates a new char buffer by wrapping the given char array. |
CharBuffer | wrap(CharSequence chseq) Creates a new char buffer by wrapping the given char sequence. |