|
|||||||||
| Home >> All >> java >> [ nio overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.nio
Class ByteBufferImpl

java.lang.Objectjava.nio.Buffer
java.nio.ByteBuffer
java.nio.ByteBufferImpl
- All Implemented Interfaces:
- java.lang.Comparable
- final class ByteBufferImpl
- extends ByteBuffer
This is a Heap memory implementation
| Field Summary | |
private boolean |
readOnly
|
| Fields inherited from class java.nio.ByteBuffer |
array_offset, backing_buffer, endian |
| Fields inherited from class java.nio.Buffer |
address, cap, limit, mark, pos |
| Constructor Summary | |
(package private) |
ByteBufferImpl(byte[] buffer,
int offset,
int capacity,
int limit,
int position,
int mark,
boolean readOnly)
|
| Method Summary | |
CharBuffer |
asCharBuffer()
Creates a view of this byte buffer as a char buffer. |
DoubleBuffer |
asDoubleBuffer()
Creates a view of this byte buffer as a double buffer. |
FloatBuffer |
asFloatBuffer()
Creates a view of this byte buffer as a float buffer. |
IntBuffer |
asIntBuffer()
Creates a view of this byte buffer as an integer buffer. |
LongBuffer |
asLongBuffer()
Creates a view of this byte buffer as a long buffer. |
ByteBuffer |
asReadOnlyBuffer()
Creates a new read-only ByteBuffer that shares this
buffer's content. |
ShortBuffer |
asShortBuffer()
Creates a view of this byte buffer as a short buffer. |
ByteBuffer |
compact()
Compacts this buffer. |
ByteBuffer |
duplicate()
Creates a new ByteBuffer that shares this buffer's
content. |
byte |
get()
Reads the byte at this buffer's current position,
and then increments the position. |
ByteBuffer |
get(byte[] dst,
int offset,
int length)
Bulk get |
byte |
get(int index)
Absolute get method. |
char |
getChar()
Relative get method for reading a character value. |
char |
getChar(int index)
Absolute get method for reading a character value. |
double |
getDouble()
Relative get method for reading a double value. |
double |
getDouble(int index)
Absolute get method for reading a double value. |
float |
getFloat()
Relative get method for reading a float value. |
float |
getFloat(int index)
Absolute get method for reading a float value. |
int |
getInt()
Relative get method for reading an integer value. |
int |
getInt(int index)
Absolute get method for reading an integer value. |
long |
getLong()
Relative get method for reading a long value. |
long |
getLong(int index)
Absolute get method for reading a long value. |
short |
getShort()
Relative get method for reading a short value. |
short |
getShort(int index)
Absolute get method for reading a short value. |
boolean |
isDirect()
Tells whether or not this buffer is direct. |
boolean |
isReadOnly()
Tells whether this buffer is read only or not. |
ByteBuffer |
put(byte value)
Relative put method. |
ByteBuffer |
put(byte[] src,
int offset,
int length)
Relative bulk put(), overloads the ByteBuffer impl. |
ByteBuffer |
put(int index,
byte value)
Absolute put method. |
ByteBuffer |
putChar(char value)
Relative put method for writing a character value. |
ByteBuffer |
putChar(int index,
char value)
Absolute put method for writing a character value. |
ByteBuffer |
putDouble(double value)
Relative put method for writing a double value. |
ByteBuffer |
putDouble(int index,
double value)
Absolute put method for writing a double value. |
ByteBuffer |
putFloat(float value)
Relative put method for writing a float value. |
ByteBuffer |
putFloat(int index,
float value)
Relative put method for writing a float value. |
ByteBuffer |
putInt(int value)
Relative put method for writing an integer value. |
ByteBuffer |
putInt(int index,
int value)
Absolute put method for writing an integer value. |
ByteBuffer |
putLong(int index,
long value)
Absolute put method for writing a float value. |
ByteBuffer |
putLong(long value)
Relative put method for writing a long value. |
ByteBuffer |
putShort(int index,
short value)
Absolute put method for writing a short value. |
ByteBuffer |
putShort(short value)
Relative put method for writing a short value. |
(package private) void |
shiftDown(int dst_offset,
int src_offset,
int count)
|
ByteBuffer |
slice()
Creates a new ByteBuffer whose content is a shared
subsequence of this buffer's content. |
| Methods inherited from class java.nio.ByteBuffer |
allocate, allocateDirect, array, arrayOffset, compareTo, equals, get, hasArray, hashCode, order, order, put, put, toString, wrap, wrap |
| Methods inherited from class java.nio.Buffer |
capacity, checkArraySize, checkForOverflow, checkForOverflow, checkForUnderflow, checkForUnderflow, checkIfReadOnly, checkIndex, clear, flip, hasRemaining, limit, limit, mark, position, position, remaining, reset, rewind |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
readOnly
private boolean readOnly
| Constructor Detail |
ByteBufferImpl
ByteBufferImpl(byte[] buffer,
int offset,
int capacity,
int limit,
int position,
int mark,
boolean readOnly)
| Method Detail |
asCharBuffer
public CharBuffer asCharBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as a char buffer.
- Specified by:
asCharBufferin classByteBuffer
asShortBuffer
public ShortBuffer asShortBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as a short buffer.
- Specified by:
asShortBufferin classByteBuffer
asIntBuffer
public IntBuffer asIntBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as an integer buffer.
- Specified by:
asIntBufferin classByteBuffer
asLongBuffer
public LongBuffer asLongBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as a long buffer.
- Specified by:
asLongBufferin classByteBuffer
asFloatBuffer
public FloatBuffer asFloatBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as a float buffer.
- Specified by:
asFloatBufferin classByteBuffer
asDoubleBuffer
public DoubleBuffer asDoubleBuffer()
- Description copied from class:
ByteBuffer - Creates a view of this byte buffer as a double buffer.
- Specified by:
asDoubleBufferin classByteBuffer
isReadOnly
public boolean isReadOnly()
- Description copied from class:
Buffer - Tells whether this buffer is read only or not.
- Specified by:
isReadOnlyin classBuffer
slice
public ByteBuffer slice()
- Description copied from class:
ByteBuffer - Creates a new
ByteBufferwhose content is a shared subsequence of this buffer's content.- Specified by:
slicein classByteBuffer
duplicate
public ByteBuffer duplicate()
- Description copied from class:
ByteBuffer - Creates a new
ByteBufferthat shares this buffer's content.- Specified by:
duplicatein classByteBuffer
asReadOnlyBuffer
public ByteBuffer asReadOnlyBuffer()
- Description copied from class:
ByteBuffer - Creates a new read-only
ByteBufferthat shares this buffer's content.- Specified by:
asReadOnlyBufferin classByteBuffer
shiftDown
void shiftDown(int dst_offset,
int src_offset,
int count)
- Overrides:
shiftDownin classByteBuffer
compact
public ByteBuffer compact()
- Description copied from class:
ByteBuffer - Compacts this buffer.
- Specified by:
compactin classByteBuffer
isDirect
public boolean isDirect()
- Description copied from class:
ByteBuffer - Tells whether or not this buffer is direct.
- Specified by:
isDirectin classByteBuffer
get
public byte get()
- Reads the
byteat this buffer's current position, and then increments the position.- Specified by:
getin classByteBuffer
get
public ByteBuffer get(byte[] dst, int offset, int length)
- Bulk get
- Overrides:
getin classByteBuffer
put
public ByteBuffer put(byte[] src, int offset, int length)
- Relative bulk put(), overloads the ByteBuffer impl.
- Overrides:
putin classByteBuffer
put
public ByteBuffer put(byte value)
- Relative put method. Writes
valueto the next position in the buffer.- Specified by:
putin classByteBuffer
get
public byte get(int index)
- Absolute get method. Reads the
byteat positionindex.- Specified by:
getin classByteBuffer
put
public ByteBuffer put(int index, byte value)
- Absolute put method. Writes
valueto positionindexin the buffer.- Specified by:
putin classByteBuffer
getChar
public char getChar()
- Description copied from class:
ByteBuffer - Relative get method for reading a character value.
- Specified by:
getCharin classByteBuffer
putChar
public ByteBuffer putChar(char value)
- Description copied from class:
ByteBuffer - Relative put method for writing a character value.
- Specified by:
putCharin classByteBuffer
getChar
public char getChar(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading a character value.
- Specified by:
getCharin classByteBuffer
putChar
public ByteBuffer putChar(int index, char value)
- Description copied from class:
ByteBuffer - Absolute put method for writing a character value.
- Specified by:
putCharin classByteBuffer
getShort
public short getShort()
- Description copied from class:
ByteBuffer - Relative get method for reading a short value.
- Specified by:
getShortin classByteBuffer
putShort
public ByteBuffer putShort(short value)
- Description copied from class:
ByteBuffer - Relative put method for writing a short value.
- Specified by:
putShortin classByteBuffer
getShort
public short getShort(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading a short value.
- Specified by:
getShortin classByteBuffer
putShort
public ByteBuffer putShort(int index, short value)
- Description copied from class:
ByteBuffer - Absolute put method for writing a short value.
- Specified by:
putShortin classByteBuffer
getInt
public int getInt()
- Description copied from class:
ByteBuffer - Relative get method for reading an integer value.
- Specified by:
getIntin classByteBuffer
putInt
public ByteBuffer putInt(int value)
- Description copied from class:
ByteBuffer - Relative put method for writing an integer value.
- Specified by:
putIntin classByteBuffer
getInt
public int getInt(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading an integer value.
- Specified by:
getIntin classByteBuffer
putInt
public ByteBuffer putInt(int index, int value)
- Description copied from class:
ByteBuffer - Absolute put method for writing an integer value.
- Specified by:
putIntin classByteBuffer
getLong
public long getLong()
- Description copied from class:
ByteBuffer - Relative get method for reading a long value.
- Specified by:
getLongin classByteBuffer
putLong
public ByteBuffer putLong(long value)
- Description copied from class:
ByteBuffer - Relative put method for writing a long value.
- Specified by:
putLongin classByteBuffer
getLong
public long getLong(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading a long value.
- Specified by:
getLongin classByteBuffer
putLong
public ByteBuffer putLong(int index, long value)
- Description copied from class:
ByteBuffer - Absolute put method for writing a float value.
- Specified by:
putLongin classByteBuffer
getFloat
public float getFloat()
- Description copied from class:
ByteBuffer - Relative get method for reading a float value.
- Specified by:
getFloatin classByteBuffer
putFloat
public ByteBuffer putFloat(float value)
- Description copied from class:
ByteBuffer - Relative put method for writing a float value.
- Specified by:
putFloatin classByteBuffer
getFloat
public float getFloat(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading a float value.
- Specified by:
getFloatin classByteBuffer
putFloat
public ByteBuffer putFloat(int index, float value)
- Description copied from class:
ByteBuffer - Relative put method for writing a float value.
- Specified by:
putFloatin classByteBuffer
getDouble
public double getDouble()
- Description copied from class:
ByteBuffer - Relative get method for reading a double value.
- Specified by:
getDoublein classByteBuffer
putDouble
public ByteBuffer putDouble(double value)
- Description copied from class:
ByteBuffer - Relative put method for writing a double value.
- Specified by:
putDoublein classByteBuffer
getDouble
public double getDouble(int index)
- Description copied from class:
ByteBuffer - Absolute get method for reading a double value.
- Specified by:
getDoublein classByteBuffer
putDouble
public ByteBuffer putDouble(int index, double value)
- Description copied from class:
ByteBuffer - Absolute put method for writing a double value.
- Specified by:
putDoublein classByteBuffer
|
|||||||||
| Home >> All >> java >> [ nio overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC