public class ExtendedByteBuffer
extends java.lang.Object
ByteBuffer
Constructor and Description |
---|
ExtendedByteBuffer(byte[] array)
Allocates an ExtendedByteBuffer by calling
ByteBuffer.wrap(byte[]) internally |
ExtendedByteBuffer(byte[] array,
int offset,
int length)
Allocates an ExtendedByteBuffer by calling
ByteBuffer.wrap(byte[], int, int) internally |
ExtendedByteBuffer(int capacity)
Allocates an ExtendedByteBuffer by calling
ByteBuffer.allocate(int) internally |
ExtendedByteBuffer(int capacity,
boolean isDirect)
Allocates an ExtendedByteBuffer by calling
ByteBuffer.allocate(int) internally |
Modifier and Type | Method and Description |
---|---|
byte[] |
array() |
int |
arrayOffset() |
java.nio.ByteBuffer |
asByteBuffer() |
java.nio.CharBuffer |
asCharBuffer() |
java.nio.DoubleBuffer |
asDoubleBuffer() |
java.nio.FloatBuffer |
asFloatBuffer() |
java.nio.IntBuffer |
asIntBuffer() |
java.nio.LongBuffer |
asLongBuffer() |
java.nio.ByteBuffer |
asReadOnlyBuffer() |
java.nio.ShortBuffer |
asShortBuffer() |
void |
blockAlign()
If the buffer is currently at an odd position, it will advance
to an even position.
|
int |
capacity() |
java.nio.Buffer |
clear() |
java.nio.ByteBuffer |
compact() |
int |
compareTo(java.nio.ByteBuffer that) |
java.nio.ByteBuffer |
duplicate() |
boolean |
equals(java.lang.Object ob) |
java.nio.Buffer |
flip() |
byte |
getByte() |
byte |
getByte(int index) |
java.nio.ByteBuffer |
getBytes(byte[] dst) |
java.nio.ByteBuffer |
getBytes(byte[] dst,
int offset,
int length) |
byte[] |
getBytes(int position,
int length) |
char |
getChar() |
char |
getChar(int index) |
double |
getDouble() |
double |
getDouble(int index) |
float |
getFloat() |
float |
getFloat(int index) |
int |
getInt() |
int |
getInt(int index) |
long |
getLong() |
long |
getLong(int index) |
short |
getShort() |
short |
getShort(int index) |
int |
getUnsignedByte() |
int |
getUnsignedByte(int index) |
long |
getUnsignedInt() |
long |
getUnsignedInt(int index) |
int |
getUnsignedShort() |
int |
getUnsignedShort(int index) |
boolean |
hasArray() |
int |
hashCode() |
boolean |
hasRemaining() |
boolean |
isDirect() |
boolean |
isReadOnly() |
int |
limit() |
java.nio.Buffer |
limit(int newLimit) |
java.nio.Buffer |
mark() |
java.nio.ByteOrder |
order() |
java.nio.ByteBuffer |
order(java.nio.ByteOrder bo) |
int |
position() |
java.nio.Buffer |
position(int newPosition) |
void |
putBlockAlign()
If the buffer is currently at an odd position, it will advance
to an even position by writing a byte with value 0x00.
|
java.nio.ByteBuffer |
putByte(byte b) |
java.nio.ByteBuffer |
putByte(int index,
byte b) |
java.nio.ByteBuffer |
putByteBuffer(java.nio.ByteBuffer src) |
java.nio.ByteBuffer |
putBytes(byte[] src) |
java.nio.ByteBuffer |
putBytes(byte[] src,
int offset,
int length) |
java.nio.ByteBuffer |
putChar(char value) |
java.nio.ByteBuffer |
putChar(int index,
char value) |
java.nio.ByteBuffer |
putDouble(double value) |
java.nio.ByteBuffer |
putDouble(int index,
double value) |
java.nio.ByteBuffer |
putFloat(float value) |
java.nio.ByteBuffer |
putFloat(int index,
float value) |
java.nio.ByteBuffer |
putInt(int value) |
java.nio.ByteBuffer |
putInt(int index,
int value) |
java.nio.ByteBuffer |
putLong(int index,
long value) |
java.nio.ByteBuffer |
putLong(long value) |
java.nio.ByteBuffer |
putShort(int index,
short value) |
java.nio.ByteBuffer |
putShort(short value) |
void |
putUnsignedByte(int value) |
void |
putUnsignedByte(int index,
int value) |
void |
putUnsignedInt(int index,
long value) |
void |
putUnsignedInt(long value) |
void |
putUnsignedShort(int value) |
void |
putUnsignedShort(int index,
int value) |
int |
remaining() |
java.nio.Buffer |
reset() |
java.nio.Buffer |
rewind() |
java.nio.ByteBuffer |
slice() |
java.lang.String |
toString() |
public ExtendedByteBuffer(int capacity)
ByteBuffer.allocate(int)
internallycapacity
- ByteBuffer.allocate(int)
public ExtendedByteBuffer(int capacity, boolean isDirect)
ByteBuffer.allocate(int)
internallycapacity
- isDirect
- whether or not to internally call ByteBuffer.allocate(int)
or ByteBuffer.allocateDirect(int)
ByteBuffer.allocate(int)
public ExtendedByteBuffer(byte[] array)
ByteBuffer.wrap(byte[])
internallyarray
- public ExtendedByteBuffer(byte[] array, int offset, int length)
ByteBuffer.wrap(byte[], int, int)
internallyarray
- offset
- length
- public final byte[] array()
ByteBuffer.array()
public final int arrayOffset()
ByteBuffer.arrayOffset()
public java.nio.ByteBuffer asByteBuffer()
public java.nio.CharBuffer asCharBuffer()
ByteBuffer.asCharBuffer()
public java.nio.DoubleBuffer asDoubleBuffer()
ByteBuffer.asDoubleBuffer()
public java.nio.FloatBuffer asFloatBuffer()
ByteBuffer.asFloatBuffer()
public java.nio.IntBuffer asIntBuffer()
ByteBuffer.asIntBuffer()
public java.nio.LongBuffer asLongBuffer()
ByteBuffer.asLongBuffer()
public java.nio.ByteBuffer asReadOnlyBuffer()
ByteBuffer.asReadOnlyBuffer()
public java.nio.ShortBuffer asShortBuffer()
ByteBuffer.asShortBuffer()
public void blockAlign()
java.io.IOException
public final int capacity()
Buffer.capacity()
public final java.nio.Buffer clear()
Buffer.clear()
public java.nio.ByteBuffer compact()
ByteBuffer.compact()
public int compareTo(java.nio.ByteBuffer that)
that
- ByteBuffer.compareTo(java.nio.ByteBuffer)
public java.nio.ByteBuffer duplicate()
ByteBuffer.duplicate()
public boolean equals(java.lang.Object ob)
equals
in class java.lang.Object
ob
- ByteBuffer.equals(java.lang.Object)
public final java.nio.Buffer flip()
Buffer.flip()
public byte getByte()
ByteBuffer.get()
public byte getByte(int index)
index
- ByteBuffer.get(int)
public java.nio.ByteBuffer getBytes(byte[] dst)
dst
- ByteBuffer.get(byte[])
public java.nio.ByteBuffer getBytes(byte[] dst, int offset, int length)
dst
- offset
- length
- ByteBuffer.get(byte[], int, int)
public byte[] getBytes(int position, int length)
position
- The position in which to start getting bytes. Must be non-negative and no larger than the current limitlength
- The number of bytes to get. Must be non-negative, and position+length should be no larger than the current limit.public char getChar()
ByteBuffer.getChar()
public char getChar(int index)
index
- ByteBuffer.getChar(int)
public double getDouble()
ByteBuffer.getDouble()
public double getDouble(int index)
index
- ByteBuffer.getDouble(int)
public float getFloat()
ByteBuffer.getFloat()
public float getFloat(int index)
index
- ByteBuffer.getFloat(int)
public int getInt()
ByteBuffer.getInt()
public int getInt(int index)
index
- ByteBuffer.getInt(int)
public long getLong()
ByteBuffer.getLong()
public long getLong(int index)
index
- ByteBuffer.getLong(int)
public short getShort()
ByteBuffer.getShort()
public short getShort(int index)
index
- ByteBuffer.getShort(int)
public int getUnsignedByte()
public int getUnsignedByte(int index)
index
- public long getUnsignedInt()
public long getUnsignedInt(int index)
index
- public int getUnsignedShort()
public int getUnsignedShort(int index)
index
- public final boolean hasArray()
ByteBuffer.hasArray()
public int hashCode()
hashCode
in class java.lang.Object
ByteBuffer.hashCode()
public final boolean hasRemaining()
Buffer.hasRemaining()
public boolean isDirect()
ByteBuffer.isDirect()
public boolean isReadOnly()
Buffer.isReadOnly()
public final int limit()
Buffer.limit()
public final java.nio.Buffer limit(int newLimit)
newLimit
- Buffer.limit(int)
public final java.nio.Buffer mark()
Buffer.mark()
public final java.nio.ByteOrder order()
ByteBuffer.order()
public final java.nio.ByteBuffer order(java.nio.ByteOrder bo)
bo
- ByteBuffer.order(java.nio.ByteOrder)
public final int position()
Buffer.position()
public final java.nio.Buffer position(int newPosition)
newPosition
- Buffer.position(int)
public void putBlockAlign()
java.io.IOException
public java.nio.ByteBuffer putByte(byte b)
b
- ByteBuffer.put(byte)
public java.nio.ByteBuffer putByte(int index, byte b)
index
- b
- ByteBuffer.put(int, byte)
public java.nio.ByteBuffer putByteBuffer(java.nio.ByteBuffer src)
src
- ByteBuffer.put(java.nio.ByteBuffer)
public final java.nio.ByteBuffer putBytes(byte[] src)
src
- ByteBuffer.put(byte[])
public java.nio.ByteBuffer putBytes(byte[] src, int offset, int length)
src
- offset
- length
- ByteBuffer.put(byte[], int, int)
public java.nio.ByteBuffer putChar(char value)
value
- ByteBuffer.putChar(char)
public java.nio.ByteBuffer putChar(int index, char value)
index
- value
- ByteBuffer.putChar(int, char)
public java.nio.ByteBuffer putDouble(double value)
value
- ByteBuffer.putDouble(double)
public java.nio.ByteBuffer putDouble(int index, double value)
index
- value
- ByteBuffer.putDouble(int, double)
public java.nio.ByteBuffer putFloat(float value)
value
- ByteBuffer.putFloat(float)
public java.nio.ByteBuffer putFloat(int index, float value)
index
- value
- ByteBuffer.putFloat(int, float)
public java.nio.ByteBuffer putInt(int index, int value)
index
- value
- ByteBuffer.putInt(int, int)
public java.nio.ByteBuffer putInt(int value)
value
- ByteBuffer.putInt(int)
public java.nio.ByteBuffer putLong(int index, long value)
index
- value
- ByteBuffer.putLong(int, long)
public java.nio.ByteBuffer putLong(long value)
value
- ByteBuffer.putLong(long)
public java.nio.ByteBuffer putShort(int index, short value)
index
- value
- ByteBuffer.putShort(int, short)
public java.nio.ByteBuffer putShort(short value)
value
- ByteBuffer.putShort(short)
public void putUnsignedByte(int value)
value
- public void putUnsignedByte(int index, int value)
index
- value
- public void putUnsignedInt(long value)
value
- public void putUnsignedInt(int index, long value)
index
- value
- public void putUnsignedShort(int value)
value
- public void putUnsignedShort(int index, int value)
index
- value
- public final int remaining()
Buffer.remaining()
public final java.nio.Buffer reset()
Buffer.reset()
public final java.nio.Buffer rewind()
Buffer.rewind()
public java.nio.ByteBuffer slice()
ByteBuffer.slice()
public java.lang.String toString()
toString
in class java.lang.Object
ByteBuffer.toString()