Save This Page
Home » openjdk-7 » java » nio » [javadoc | source]
java.nio
abstract public class: CharBuffer [javadoc | source]
java.lang.Object
   java.nio.Buffer
      java.nio.CharBuffer

All Implemented Interfaces:
    CharSequence, Comparable

Direct Known Subclasses:
    CharBufferImpl, CharViewBufferImpl, StringCharBuffer

Field Summary
 int array_offset     
 char[] backing_buffer     
Fields inherited from java.nio.Buffer:
address
Constructor:
 CharBuffer(int capacity,
    int limit,
    int position,
    int mark) 
Method from java.nio.CharBuffer Summary:
allocate,   array,   arrayOffset,   asReadOnlyBuffer,   charAt,   compact,   compareTo,   duplicate,   equals,   get,   get,   get,   get,   hasArray,   hashCode,   isDirect,   length,   order,   put,   put,   put,   put,   put,   put,   put,   slice,   subSequence,   toString,   wrap,   wrap,   wrap,   wrap
Methods from java.nio.Buffer:
array,   arrayOffset,   capacity,   checkBounds,   checkIndex,   checkIndex,   clear,   flip,   hasArray,   hasRemaining,   isDirect,   isReadOnly,   limit,   limit,   mark,   markValue,   nextGetIndex,   nextGetIndex,   nextPutIndex,   nextPutIndex,   position,   position,   remaining,   reset,   rewind
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.nio.CharBuffer Detail:
 public static CharBuffer allocate(int capacity) 
    Allocates a new CharBuffer object with a given capacity.
 public final char[] array() 
    Returns the char array that backs this buffer.
 public final int arrayOffset() 
    Returns the offset within this buffer's backing array of the first element.
 abstract public CharBuffer asReadOnlyBuffer()
    Creates a new read-only CharBuffer that shares this buffer's content.
 public final char charAt(int index) 
    Returns the character at position() + index.
 abstract public CharBuffer compact()
    Compacts this buffer.
 public int compareTo(Object obj) 
    Compares two CharBuffer objects.
 abstract public CharBuffer duplicate()
    Creates a new CharBuffer that shares this buffer's content.
 public boolean equals(Object obj) 
    Checks if this buffer is equal to obj.
 abstract public char get()
    Reads the char at this buffer's current position, and then increments the position.
 public CharBuffer get(char[] dst) 
    This method transfers chars from this buffer into the given destination array.
 abstract public char get(int index)
    Absolute get method.
 public CharBuffer get(char[] dst,
    int offset,
    int length) 
    This method transfers chars from this buffer into the given destination array. Before the transfer, it checks if there are fewer than length chars remaining in this buffer.
 public final boolean hasArray() 
    Tells whether ot not this buffer is backed by an accessible char array.
 public int hashCode() 
    Calculates a hash code for this buffer. This is done with int arithmetic, where ** represents exponentiation, by this formula:
    s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... + (s[limit()-1]+30)*31**(limit()-1). Where s is the buffer data. Note that the hashcode is dependent on buffer content, and therefore is not useful if the buffer content may change.
 abstract public boolean isDirect()
    Tells wether or not this buffer is direct.
 public final int length() 
    Returns the length of the remaining chars in this buffer.
 abstract public ByteOrder order()
    Returns the byte order of this buffer.
 public CharBuffer put(CharBuffer src) 
    Writes the content of the the CharBUFFER src into the buffer. Before the transfer, it checks if there is fewer than src.remaining() space remaining in this buffer.
 public final CharBuffer put(char[] src) 
    Writes the content of the the char array src into the buffer.
 abstract public CharBuffer put(char b)
    Writes the char at this buffer's current position, and then increments the position.
 public final CharBuffer put(String str) 
    Relative put method.
 abstract public CharBuffer put(int index,
    char b)
    Absolute put method.
 public CharBuffer put(char[] src,
    int offset,
    int length) 
    Writes the content of the the char array src into the buffer. Before the transfer, it checks if there is fewer than length space remaining in this buffer.
 public CharBuffer put(String str,
    int start,
    int length) 
    Relative put method.
 abstract public CharBuffer slice()
    Creates a new CharBuffer whose content is a shared subsequence of this buffer's content.
 abstract public CharSequence subSequence(int start,
    int length)
    Creates a new character buffer that represents the specified subsequence of this buffer, relative to the current position.
 public String toString() 
    Returns the remaining content of the buffer as a string.
 public static final CharBuffer wrap(CharSequence seq) 
    Wraps a character sequence into a CharBuffer object.
 public static final CharBuffer wrap(char[] array) 
    Wraps a char array into a CharBuffer object.
 public static final CharBuffer wrap(char[] array,
    int offset,
    int length) 
    Wraps a char array into a CharBuffer object.
 public static final CharBuffer wrap(CharSequence seq,
    int start,
    int end) 
    Wraps a character sequence into a CharBuffer object.