|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.Buffer
java.nio.ByteBuffer
java.nio.BaseByteBuffer
abstract class BaseByteBuffer
Serves as the root of other byte buffer impl classes, implements common methods that can be shared by child classes.
| Field Summary |
|---|
| Fields inherited from class java.nio.ByteBuffer |
|---|
order |
| Fields inherited from class java.nio.Buffer |
|---|
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK |
| Constructor Summary | |
|---|---|
protected |
BaseByteBuffer(int capacity)
|
| Method Summary | |
|---|---|
CharBuffer |
asCharBuffer()
Returns a char buffer which is based on the remaining content of this byte buffer. |
DoubleBuffer |
asDoubleBuffer()
Returns a double buffer which is based on the remaining content of this byte buffer. |
FloatBuffer |
asFloatBuffer()
Returns a float buffer which is based on the remaining content of this byte buffer. |
IntBuffer |
asIntBuffer()
Returns a int buffer which is based on the remaining content of this byte buffer. |
LongBuffer |
asLongBuffer()
Returns a long buffer which is based on the remaining content of this byte buffer. |
ShortBuffer |
asShortBuffer()
Returns a short buffer which is based on the remaining content of this byte buffer. |
char |
getChar()
Returns the char at the current position and increase the position by 2. |
char |
getChar(int index)
Returns the char at the specified index. |
ByteBuffer |
putChar(char value)
Writes the given char to the current position and increase the position by 2. |
ByteBuffer |
putChar(int index,
char value)
Write a char to the specified index of this buffer. |
| Methods inherited from class java.nio.ByteBuffer |
|---|
_array, _arrayOffset, allocate, allocateDirect, array, arrayOffset, asReadOnlyBuffer, compact, compareTo, duplicate, equals, get, get, get, get, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, hasArray, hashCode, isDirect, order, order, orderImpl, protectedArray, protectedArrayOffset, protectedHasArray, put, put, put, put, put, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, slice, toString, wrap, wrap |
| Methods inherited from class java.nio.Buffer |
|---|
capacity, clear, flip, hasRemaining, isReadOnly, limit, limit, mark, position, position, remaining, reset, rewind |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BaseByteBuffer(int capacity)
| Method Detail |
|---|
public final CharBuffer asCharBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asCharBuffer in class ByteBufferpublic final DoubleBuffer asDoubleBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asDoubleBuffer in class ByteBufferpublic final FloatBuffer asFloatBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asFloatBuffer in class ByteBufferpublic final IntBuffer asIntBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asIntBuffer in class ByteBufferpublic final LongBuffer asLongBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asLongBuffer in class ByteBufferpublic final ShortBuffer asShortBuffer()
ByteBufferThe new buffer's position is zero, its limit and capacity is the number of remaining bytes divided by two, and its mark is not set. The new buffer's readonly property and byte order are same as this buffer. The new buffer is direct, if this byte buffer is direct.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
asShortBuffer in class ByteBufferpublic final char getChar()
ByteBufferThe 2 bytes start from the current position are composed into a char according to current byte order and returned. The position increases by 2.
getChar in class ByteBufferpublic final char getChar(int index)
ByteBufferThe 2 bytes start from the specified index are composed into a char according to current byte order and returned. The position is not changed.
getChar in class ByteBufferindex - The index, must be no less than zero and equal or less than
limit - 2
public final ByteBuffer putChar(char value)
ByteBufferThe char is converted to bytes using the current byte order.
putChar in class ByteBuffervalue - The char to write
public final ByteBuffer putChar(int index,
char value)
ByteBufferThe char is converted to bytes using the current byte order. The position is not changed.
putChar in class ByteBufferindex - The index, must be no less than zero and equal or less than
limit - 2value - The char to write
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||