Method from java.nio.CharBufferImpl Detail: |
public CharBuffer asReadOnlyBuffer() {
return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
}
|
public CharBuffer compact() {
checkIfReadOnly();
mark = -1;
int p = position();
int n = limit() - p;
if (n > 0)
{
System.arraycopy(backing_buffer, array_offset + p,
backing_buffer, array_offset, n);
}
position(n);
limit(capacity());
return this;
}
|
public CharBuffer duplicate() {
return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
}
|
public char get() {
if (pos >= limit)
throw new BufferUnderflowException();
return backing_buffer [(pos++) + array_offset];
}
Reads the char at this buffer's current position,
and then increments the position. |
public char get(int index) {
checkIndex(index);
return backing_buffer [index + array_offset];
}
Absolute get method. Reads the char at position
index . |
public CharBuffer get(char[] dst,
int offset,
int length) {
checkArraySize(dst.length, offset, length);
checkForUnderflow(length);
System.arraycopy(backing_buffer, pos + array_offset,
dst, offset, length);
pos += length;
return this;
}
Bulk get, overloaded for speed. |
public boolean isDirect() {
return false;
}
|
public boolean isReadOnly() {
return readOnly;
}
|
public ByteOrder order() {
return ByteOrder.nativeOrder ();
}
|
public CharBuffer put(char value) {
if (readOnly)
throw new ReadOnlyBufferException();
if (pos >= limit)
throw new BufferOverflowException();
backing_buffer [(pos++) + array_offset] = value;
return this;
}
Relative put method. Writes value to the next position
in the buffer. |
public CharBuffer put(int index,
char value) {
checkIndex(index);
checkIfReadOnly();
backing_buffer [index + array_offset] = value;
return this;
}
Absolute put method. Writes value to position
index in the buffer. |
public CharBuffer put(char[] src,
int offset,
int length) {
checkArraySize(src.length, offset, length);
checkForOverflow(length);
System.arraycopy(src, offset,
backing_buffer, pos + array_offset, length);
pos += length;
return this;
}
Bulk put, overloaded for speed. |
public CharBuffer slice() {
return new CharBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
}
|
public CharSequence subSequence(int start,
int end) {
if (start < 0
|| start > length ()
|| end < start
|| end > length ())
throw new IndexOutOfBoundsException ();
return new CharBufferImpl (backing_buffer, array_offset, capacity (), position () + end, position () + start, -1, isReadOnly ());
}
|