static
ByteBuffer
|
allocate(int capacity)
Creates a byte buffer based on a newly allocated byte array.
|
static
ByteBuffer
|
allocateDirect(int capacity)
Creates a direct byte buffer based on a newly allocated memory block.
|
final
byte[]
|
array()
Returns the byte array which this buffer is based on, if there is one.
|
final
int
|
arrayOffset()
Returns the offset of the byte array which this buffer is based on, if
there is one.
|
abstract
CharBuffer
|
asCharBuffer()
Returns a char buffer which is based on the remaining content of this
byte buffer.
|
abstract
DoubleBuffer
|
asDoubleBuffer()
Returns a double buffer which is based on the remaining content of this
byte buffer.
|
abstract
FloatBuffer
|
asFloatBuffer()
Returns a float buffer which is based on the remaining content of this
byte buffer.
|
abstract
IntBuffer
|
asIntBuffer()
Returns a int buffer which is based on the remaining content of this byte
buffer.
|
abstract
LongBuffer
|
asLongBuffer()
Returns a long buffer which is based on the remaining content of this
byte buffer.
|
abstract
ByteBuffer
|
asReadOnlyBuffer()
Returns a read-only buffer that shares its content with this buffer.
|
abstract
ShortBuffer
|
asShortBuffer()
Returns a short buffer which is based on the remaining content of this
byte buffer.
|
abstract
ByteBuffer
|
compact()
Compacts this byte buffer.
|
int
|
compareTo(ByteBuffer otherBuffer)
Compares the remaining bytes of this buffer to another byte buffer's
remaining bytes.
|
abstract
ByteBuffer
|
duplicate()
Returns a duplicated buffer that shares its content with this buffer.
|
boolean
|
equals(Object other)
Checks whether this byte buffer is equal to another object.
|
abstract
byte
|
get()
Returns the byte at the current position and increases the position by 1.
|
ByteBuffer
|
get(byte[] dest, int off, int len)
Reads bytes from the current position into the specified byte array,
starting at the specified offset, and increases the position by the
number of bytes read.
|
ByteBuffer
|
get(byte[] dest)
Reads bytes from the current position into the specified byte array and
increases the position by the number of bytes read.
|
abstract
byte
|
get(int index)
Returns the byte at the specified index and does not change the position.
|
abstract
char
|
getChar(int index)
Returns the char at the specified index.
|
abstract
char
|
getChar()
Returns the char at the current position and increases the position by 2.
|
abstract
double
|
getDouble()
Returns the double at the current position and increases the position by
8.
|
abstract
double
|
getDouble(int index)
Returns the double at the specified index.
|
abstract
float
|
getFloat()
Returns the float at the current position and increases the position by
4.
|
abstract
float
|
getFloat(int index)
Returns the float at the specified index.
|
abstract
int
|
getInt(int index)
Returns the int at the specified index.
|
abstract
int
|
getInt()
Returns the int at the current position and increases the position by 4.
|
abstract
long
|
getLong()
Returns the long at the current position and increases the position by 8.
|
abstract
long
|
getLong(int index)
Returns the long at the specified index.
|
abstract
short
|
getShort(int index)
Returns the short at the specified index.
|
abstract
short
|
getShort()
Returns the short at the current position and increases the position by 2.
|
final
boolean
|
hasArray()
Indicates whether this buffer is based on a byte array and provides
read/write access.
|
int
|
hashCode()
Calculates this buffer's hash code from the remaining chars.
|
abstract
boolean
|
isDirect()
Indicates whether this buffer is direct.
|
final
ByteOrder
|
order()
Returns the byte order used by this buffer when converting bytes from/to
other primitive types.
|
final
ByteBuffer
|
order(ByteOrder byteOrder)
Sets the byte order of this buffer.
|
final
ByteBuffer
|
put(byte[] src)
Writes bytes in the given byte array to the current position and
increases the position by the number of bytes written.
|
abstract
ByteBuffer
|
put(byte b)
Writes the given byte to the current position and increases the position
by 1.
|
abstract
ByteBuffer
|
put(int index, byte b)
Write a byte to the specified index of this buffer without changing the
position.
|
ByteBuffer
|
put(ByteBuffer src)
Writes all the remaining bytes of the src byte buffer to this
buffer's current position, and increases both buffers' position by the
number of bytes copied.
|
ByteBuffer
|
put(byte[] src, int off, int len)
Writes bytes in the given byte array, starting from the specified offset,
to the current position and increases the position by the number of bytes
written.
|
abstract
ByteBuffer
|
putChar(int index, char value)
Writes the given char to the specified index of this buffer.
|
abstract
ByteBuffer
|
putChar(char value)
Writes the given char to the current position and increases the position
by 2.
|
abstract
ByteBuffer
|
putDouble(int index, double value)
Writes the given double to the specified index of this buffer.
|
abstract
ByteBuffer
|
putDouble(double value)
Writes the given double to the current position and increases the position
by 8.
|
abstract
ByteBuffer
|
putFloat(int index, float value)
Writes the given float to the specified index of this buffer.
|
abstract
ByteBuffer
|
putFloat(float value)
Writes the given float to the current position and increases the position
by 4.
|
abstract
ByteBuffer
|
putInt(int value)
Writes the given int to the current position and increases the position by
4.
|
abstract
ByteBuffer
|
putInt(int index, int value)
Writes the given int to the specified index of this buffer.
|
abstract
ByteBuffer
|
putLong(long value)
Writes the given long to the current position and increases the position
by 8.
|
abstract
ByteBuffer
|
putLong(int index, long value)
Writes the given long to the specified index of this buffer.
|
abstract
ByteBuffer
|
putShort(int index, short value)
Writes the given short to the specified index of this buffer.
|
abstract
ByteBuffer
|
putShort(short value)
Writes the given short to the current position and increases the position
by 2.
|
abstract
ByteBuffer
|
slice()
Returns a sliced buffer that shares its content with this buffer.
|
String
|
toString()
Returns a string representing the state of this byte buffer.
|
static
ByteBuffer
|
wrap(byte[] array)
Creates a new byte buffer by wrapping the given byte array.
|
static
ByteBuffer
|
wrap(byte[] array, int start, int len)
Creates a new byte buffer by wrapping the given byte array.
|