public abstract class BaseByteBuffer extends ByteBuffer
ByteBuffer
. This implementation
assumes that ByteBuffer.buf()
always returns a correct NIO
ByteBuffer
instance. Most implementations could
extend this class and implement their own buffer management mechanism.ByteBufferAllocator
限定符 | 构造器和说明 |
---|---|
protected |
BaseByteBuffer() |
限定符和类型 | 方法和说明 |
---|---|
java.nio.CharBuffer |
asCharBuffer() |
java.nio.DoubleBuffer |
asDoubleBuffer() |
java.nio.FloatBuffer |
asFloatBuffer() |
java.nio.IntBuffer |
asIntBuffer() |
java.nio.LongBuffer |
asLongBuffer() |
java.nio.ShortBuffer |
asShortBuffer() |
int |
capacity() |
ByteBuffer |
capacity(int newCapacity)
Changes the capacity of this buffer.
|
protected abstract void |
capacity0(int newCapacity)
Implement this method to increase the capacity of this buffer.
|
ByteBuffer |
clear() |
ByteBuffer |
compact() |
ByteBuffer |
expand(int pos,
int expectedRemaining)
Changes the capacity and limit of this buffer so this buffer get
the specified expectedRemaining room from the specified
pos.
|
ByteBuffer |
flip() |
byte |
get() |
ByteBuffer |
get(byte[] dst,
int offset,
int length) |
byte |
get(int index) |
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) |
boolean |
isAutoExpand()
Returns true if and only if autoExpand is turned on.
|
boolean |
isDirect() |
boolean |
isReadOnly() |
int |
limit() |
ByteBuffer |
limit(int newLimit) |
ByteBuffer |
mark() |
int |
markValue()
Returns the position of the current mark.
|
java.nio.ByteOrder |
order() |
ByteBuffer |
order(java.nio.ByteOrder bo) |
int |
position() |
ByteBuffer |
position(int newPosition) |
ByteBuffer |
put(byte b) |
ByteBuffer |
put(byte[] src,
int offset,
int length) |
ByteBuffer |
put(java.nio.ByteBuffer src)
Writes the content of the specified src into this buffer.
|
ByteBuffer |
put(int index,
byte b) |
ByteBuffer |
putChar(char value) |
ByteBuffer |
putChar(int index,
char value) |
ByteBuffer |
putDouble(double value) |
ByteBuffer |
putDouble(int index,
double value) |
ByteBuffer |
putFloat(float value) |
ByteBuffer |
putFloat(int index,
float value) |
ByteBuffer |
putInt(int value) |
ByteBuffer |
putInt(int index,
int value) |
ByteBuffer |
putLong(int index,
long value) |
ByteBuffer |
putLong(long value) |
ByteBuffer |
putShort(int index,
short value) |
ByteBuffer |
putShort(short value) |
ByteBuffer |
reset() |
ByteBuffer |
rewind() |
ByteBuffer |
setAutoExpand(boolean autoExpand)
Turns on or off autoExpand.
|
acquire, allocate, allocate, array, arrayOffset, asInputStream, asOutputStream, asReadOnlyBuffer, autoExpand, autoExpand, buf, compareTo, duplicate, equals, expand, fill, fill, fillAndReset, fillAndReset, get, getAllocator, getHexDump, getObject, getObject, getPrefixedString, getPrefixedString, getString, getString, getUnsigned, getUnsigned, getUnsignedInt, getUnsignedInt, getUnsignedShort, getUnsignedShort, hashCode, hasRemaining, isPooled, isUseDirectBuffers, prefixedDataAvailable, prefixedDataAvailable, put, put, putObject, putPrefixedString, putPrefixedString, putPrefixedString, putPrefixedString, putString, putString, release, remaining, setAllocator, setPooled, setUseDirectBuffers, skip, slice, sweep, sweep, toString, wrap, wrap, wrap
public boolean isDirect()
isDirect
在类中 ByteBuffer
ByteBuffer.isDirect()
public boolean isReadOnly()
isReadOnly
在类中 ByteBuffer
Buffer.isReadOnly()
public int capacity()
capacity
在类中 ByteBuffer
Buffer.capacity()
public ByteBuffer capacity(int newCapacity)
ByteBuffer
capacity
在类中 ByteBuffer
protected abstract void capacity0(int newCapacity)
public boolean isAutoExpand()
ByteBuffer
isAutoExpand
在类中 ByteBuffer
public ByteBuffer setAutoExpand(boolean autoExpand)
ByteBuffer
setAutoExpand
在类中 ByteBuffer
public ByteBuffer expand(int pos, int expectedRemaining)
ByteBuffer
expand
在类中 ByteBuffer
public int position()
position
在类中 ByteBuffer
Buffer.position()
public ByteBuffer position(int newPosition)
position
在类中 ByteBuffer
Buffer.position(int)
public int limit()
limit
在类中 ByteBuffer
Buffer.limit()
public ByteBuffer limit(int newLimit)
limit
在类中 ByteBuffer
Buffer.limit(int)
public ByteBuffer mark()
mark
在类中 ByteBuffer
Buffer.mark()
public int markValue()
ByteBuffer
markValue
在类中 ByteBuffer
public ByteBuffer reset()
reset
在类中 ByteBuffer
Buffer.reset()
public ByteBuffer clear()
clear
在类中 ByteBuffer
Buffer.clear()
public ByteBuffer flip()
flip
在类中 ByteBuffer
Buffer.flip()
public ByteBuffer rewind()
rewind
在类中 ByteBuffer
Buffer.rewind()
public byte get()
get
在类中 ByteBuffer
ByteBuffer.get()
public ByteBuffer put(byte b)
put
在类中 ByteBuffer
ByteBuffer.put(byte)
public byte get(int index)
get
在类中 ByteBuffer
ByteBuffer.get(int)
public ByteBuffer put(int index, byte b)
put
在类中 ByteBuffer
ByteBuffer.put(int, byte)
public ByteBuffer get(byte[] dst, int offset, int length)
get
在类中 ByteBuffer
ByteBuffer.get(byte[], int, int)
public ByteBuffer put(java.nio.ByteBuffer src)
ByteBuffer
put
在类中 ByteBuffer
public ByteBuffer put(byte[] src, int offset, int length)
put
在类中 ByteBuffer
ByteBuffer.put(byte[], int, int)
public ByteBuffer compact()
compact
在类中 ByteBuffer
ByteBuffer.compact()
public java.nio.ByteOrder order()
order
在类中 ByteBuffer
ByteBuffer.order()
public ByteBuffer order(java.nio.ByteOrder bo)
order
在类中 ByteBuffer
ByteBuffer.order(ByteOrder)
public char getChar()
getChar
在类中 ByteBuffer
ByteBuffer.getChar()
public ByteBuffer putChar(char value)
putChar
在类中 ByteBuffer
ByteBuffer.putChar(char)
public char getChar(int index)
getChar
在类中 ByteBuffer
ByteBuffer.getChar(int)
public ByteBuffer putChar(int index, char value)
putChar
在类中 ByteBuffer
ByteBuffer.putChar(int, char)
public java.nio.CharBuffer asCharBuffer()
asCharBuffer
在类中 ByteBuffer
ByteBuffer.asCharBuffer()
public short getShort()
getShort
在类中 ByteBuffer
ByteBuffer.getShort()
public ByteBuffer putShort(short value)
putShort
在类中 ByteBuffer
ByteBuffer.putShort(short)
public short getShort(int index)
getShort
在类中 ByteBuffer
ByteBuffer.getShort()
public ByteBuffer putShort(int index, short value)
putShort
在类中 ByteBuffer
ByteBuffer.putShort(int, short)
public java.nio.ShortBuffer asShortBuffer()
asShortBuffer
在类中 ByteBuffer
ByteBuffer.asShortBuffer()
public int getInt()
getInt
在类中 ByteBuffer
ByteBuffer.getInt()
public ByteBuffer putInt(int value)
putInt
在类中 ByteBuffer
ByteBuffer.putInt(int)
public int getInt(int index)
getInt
在类中 ByteBuffer
ByteBuffer.getInt(int)
public ByteBuffer putInt(int index, int value)
putInt
在类中 ByteBuffer
ByteBuffer.putInt(int, int)
public java.nio.IntBuffer asIntBuffer()
asIntBuffer
在类中 ByteBuffer
ByteBuffer.asIntBuffer()
public long getLong()
getLong
在类中 ByteBuffer
ByteBuffer.getLong()
public ByteBuffer putLong(long value)
putLong
在类中 ByteBuffer
ByteBuffer.putLong(int, long)
public long getLong(int index)
getLong
在类中 ByteBuffer
ByteBuffer.getLong(int)
public ByteBuffer putLong(int index, long value)
putLong
在类中 ByteBuffer
ByteBuffer.putLong(int, long)
public java.nio.LongBuffer asLongBuffer()
asLongBuffer
在类中 ByteBuffer
ByteBuffer.asLongBuffer()
public float getFloat()
getFloat
在类中 ByteBuffer
ByteBuffer.getFloat()
public ByteBuffer putFloat(float value)
putFloat
在类中 ByteBuffer
ByteBuffer.putFloat(float)
public float getFloat(int index)
getFloat
在类中 ByteBuffer
ByteBuffer.getFloat(int)
public ByteBuffer putFloat(int index, float value)
putFloat
在类中 ByteBuffer
ByteBuffer.putFloat(int, float)
public java.nio.FloatBuffer asFloatBuffer()
asFloatBuffer
在类中 ByteBuffer
ByteBuffer.asFloatBuffer()
public double getDouble()
getDouble
在类中 ByteBuffer
ByteBuffer.getDouble()
public ByteBuffer putDouble(double value)
putDouble
在类中 ByteBuffer
ByteBuffer.putDouble(double)
public double getDouble(int index)
getDouble
在类中 ByteBuffer
ByteBuffer.getDouble(int)
public ByteBuffer putDouble(int index, double value)
putDouble
在类中 ByteBuffer
ByteBuffer.putDouble(int, double)
public java.nio.DoubleBuffer asDoubleBuffer()
asDoubleBuffer
在类中 ByteBuffer
ByteBuffer.asDoubleBuffer()