java.nio
Class CharBuffer
java.lang.Object
|
+--java.nio.Buffer
|
+--java.nio.CharBuffer
All Implemented Interfaces:
Comparable, CharSequence
Since:static java.nio.CharBuffer | allocate(int capacity)
|
char[] | array()
|
int | arrayOffset()
|
java.nio.CharBuffer | asReadOnlyBuffer()
|
char | charAt(int index)
|
java.nio.CharBuffer | compact()
|
int | compareTo(java.lang.Object obj)
|
java.nio.CharBuffer | duplicate()
|
boolean | equals(java.lang.Object obj)
|
java.nio.CharBuffer | get(char[] dst, int offset, int length)
|
java.nio.CharBuffer | get(char[] dst)
|
char | get()
|
char | get(int index)
|
boolean | hasArray()
|
int | hashCode()
|
boolean | isDirect()
|
int | length()
|
java.nio.ByteOrder | order()
|
java.nio.CharBuffer | put(java.nio.CharBuffer src)
|
java.nio.CharBuffer | put(char[] src, int offset, int length)
|
java.nio.CharBuffer | put(java.lang.String src, int offset, int length)
|
java.nio.CharBuffer | put(java.lang.String src)
|
java.nio.CharBuffer | put(char[] src)
|
java.nio.CharBuffer | put(char b)
|
java.nio.CharBuffer | put(int index, char b)
|
java.nio.CharBuffer | slice()
|
java.lang.CharSequence | subSequence(int start, int end)
|
java.lang.String | toString()
|
static java.nio.CharBuffer | wrap(char[] array, int offset, int length)
|
static java.nio.CharBuffer | wrap(char[] array)
|
static java.nio.CharBuffer | wrap(java.lang.CharSequence cs, int offset, int length)
|
static java.nio.CharBuffer | wrap(java.lang.CharSequence cs)
|
array_offset
protected int array_offset
backing_buffer
protected char[] backing_buffer
allocate
public static CharBuffer allocate(int capacity)
Allocats a non-direct character buffer.
Parameters:
array
public final char[] array()
Retrieves the backing buffer.
Throws:
arrayOffset
public final int arrayOffset()
Returns the offset within this buffer's backing array of the first element of the buffer.
Throws:
asReadOnlyBuffer
public CharBuffer asReadOnlyBuffer()
Creates a new, read-only character buffer that shares this buffer's
content.
charAt
public final char charAt(int index)
Reads the character at the given index relative to the current position.
Parameters:
Throws:
compact
public CharBuffer compact()
Compacts this buffer.
Throws:
compareTo
public int compareTo(java.lang.Object obj)
Compares this buffer to another object.
Parameters:
Throws:
duplicate
public CharBuffer duplicate()
Creates a new character buffer that shares this buffer's content.
equals
public boolean equals(java.lang.Object obj)
Tells whether or not this buffer is equal to another object.
Parameters:
get
public char get()
Relative bulk get method.
Throws:
get
public CharBuffer get(char[] dst)
Relative bulk get method.
Parameters:
Throws:
get
public CharBuffer get(char[] dst, int offset, int length)
Relative bulk get method.
Parameters:
Throws:
get
public char get(int index)
Absolute bulk get method.
Parameters:
Throws:
hasArray
public final boolean hasArray()
Tells wether this buffer has a backing array or not.
hashCode
public int hashCode()
Returns the current hash code of this buffer.
isDirect
public boolean isDirect()
Tells wether or not this is a direct buffer.
length
public final int length()
Returns the length of this character buffer.
order
public ByteOrder order()
Retrieves the current endianess of this buffer.
put
public final CharBuffer put(char[] src)
This method transfers the entire content of the given
source character array into this buffer.
Parameters:
Throws:
put
public CharBuffer put(char b)
Relative bulk get method.
Parameters:
Throws:
put
public CharBuffer put(char[] src, int offset, int length)
Relative bulk put method.
Parameters:
Throws:
put
public CharBuffer put(int index, char b)
Absolute bulk put method.
Parameters:
Throws:
put
public final CharBuffer put(java.lang.String src)
Relative bulk put method.
Parameters:
Throws:
put
public CharBuffer put(java.lang.String src, int offset, int length)
Relative bulk put method.
Parameters:
Throws:
put
public CharBuffer put(java.nio.CharBuffer src)
Relative bulk put method.
Parameters:
Throws:
slice
public CharBuffer slice()
Creates a new character buffer whose content is a shared subsequence of
this buffer's content.
subSequence
public CharSequence subSequence(int start, int end)
Creates a new character buffer that represents the specified subsequence
of this buffer, relative to the current position.
Parameters:
Throws:
toString
public String toString()
Retrieves the content of the character buffer as string.
wrap
public static final CharBuffer wrap(char[] array)
Wraps a character array into a buffer.
Parameters:
wrap
public static final CharBuffer wrap(char[] array, int offset, int length)
Wraps a character array into a buffer.
Parameters:
Throws:
wrap
public static final CharBuffer wrap(java.lang.CharSequence cs)
Wraps a character sequence into a buffer.
Parameters:
wrap
public static final CharBuffer wrap(java.lang.CharSequence cs, int offset, int length)
Wraps a character sequence into a buffer.
Parameters:
Throws: