public class IoBufferWrapper extends IoBuffer
IoBuffer that wraps a buffer and proxies any operations to it.
You can think this class like a FilterOutputStream. All operations
are proxied by default so that you can extend this class and override
existing operations selectively. You can introduce new operations, too.
| 限定符 | 构造器和说明 |
|---|---|
protected |
IoBufferWrapper(IoBuffer buf)
Create a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
array() |
int |
arrayOffset() |
CharBuffer |
asCharBuffer() |
DoubleBuffer |
asDoubleBuffer() |
FloatBuffer |
asFloatBuffer() |
InputStream |
asInputStream()
Returns an
InputStream that reads the data from this buffer. |
IntBuffer |
asIntBuffer() |
LongBuffer |
asLongBuffer() |
OutputStream |
asOutputStream()
Returns an
OutputStream that appends the data into this buffer. |
IoBuffer |
asReadOnlyBuffer() |
ShortBuffer |
asShortBuffer() |
ByteBuffer |
buf()
Returns the underlying NIO buffer instance.
|
int |
capacity() |
IoBuffer |
capacity(int newCapacity)
Increases the capacity of this buffer.
|
IoBuffer |
clear() |
IoBuffer |
compact() |
int |
compareTo(IoBuffer that) |
IoBuffer |
duplicate() |
boolean |
equals(Object ob) |
IoBuffer |
expand(int expectedRemaining)
Changes the capacity and limit of this buffer so this buffer get the
specified expectedRemaining room from the current position.
|
IoBuffer |
expand(int pos,
int expectedRemaining)
Changes the capacity and limit of this buffer so this buffer get the
specified expectedRemaining room from the specified
position.
|
IoBuffer |
fill(byte value,
int size)
Fills this buffer with the specified value.
|
IoBuffer |
fill(int size)
Fills this buffer with
NUL (0x00). |
IoBuffer |
fillAndReset(byte value,
int size)
Fills this buffer with the specified value.
|
IoBuffer |
fillAndReset(int size)
Fills this buffer with
NUL (0x00). |
IoBuffer |
flip() |
void |
free()
Declares this buffer and all its derived buffers are not used anymore so
that it can be reused by some
IoBufferAllocator implementations. |
byte |
get() |
IoBuffer |
get(byte[] dst) |
IoBuffer |
get(byte[] dst,
int offset,
int length) |
byte |
get(int index) |
char |
getChar() |
char |
getChar(int index) |
double |
getDouble() |
double |
getDouble(int index) |
<E extends Enum<E>> |
getEnum(Class<E> enumClass)
Reads a byte from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
<E extends Enum<E>> |
getEnum(int index,
Class<E> enumClass)
Reads a byte from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
<E extends Enum<E>> |
getEnumInt(Class<E> enumClass)
Reads an int from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
<E extends Enum<E>> |
getEnumInt(int index,
Class<E> enumClass)
Reads an int from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
<E extends Enum<E>> |
getEnumSet(Class<E> enumClass)
Reads a byte sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSet(int index,
Class<E> enumClass)
Reads a byte sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetInt(Class<E> enumClass)
Reads an int sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetInt(int index,
Class<E> enumClass)
Reads an int sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetLong(Class<E> enumClass)
Reads a long sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetLong(int index,
Class<E> enumClass)
Reads a long sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetShort(Class<E> enumClass)
Reads a short sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumSetShort(int index,
Class<E> enumClass)
Reads a short sized bit vector and converts it to an
EnumSet. |
<E extends Enum<E>> |
getEnumShort(Class<E> enumClass)
Reads a short from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
<E extends Enum<E>> |
getEnumShort(int index,
Class<E> enumClass)
Reads a short from the buffer and returns the correlating enum constant
defined by the specified enum type.
|
float |
getFloat() |
float |
getFloat(int index) |
String |
getHexDump()
Returns hexdump of this buffer.
|
String |
getHexDump(int lengthLimit)
Return hexdump of this buffer with limited length.
|
int |
getInt() |
int |
getInt(int index) |
long |
getLong() |
long |
getLong(int index) |
int |
getMediumInt()
Relative get method for reading a medium int value.
|
int |
getMediumInt(int index)
Absolute get method for reading a medium int value.
|
Object |
getObject()
Reads a Java object from the buffer using the context
ClassLoader
of the current thread. |
Object |
getObject(ClassLoader classLoader)
Reads a Java object from the buffer using the specified
classLoader.
|
IoBuffer |
getParentBuffer()
Returns the parent buffer that this buffer wrapped.
|
String |
getPrefixedString(CharsetDecoder decoder)
Reads a string which has a 16-bit length field before the actual encoded
string, using the specified
decoder and returns it. |
String |
getPrefixedString(int prefixLength,
CharsetDecoder decoder)
Reads a string which has a length field before the actual encoded string,
using the specified
decoder and returns it. |
short |
getShort() |
short |
getShort(int index) |
IoBuffer |
getSlice(int length)
TODO document me.
|
IoBuffer |
getSlice(int index,
int length)
TODO document me.
|
String |
getString(CharsetDecoder decoder)
Reads a
NUL-terminated string from this buffer using the
specified decoder and returns it. |
String |
getString(int fieldSize,
CharsetDecoder decoder)
Reads a
NUL-terminated string from this buffer using the
specified decoder and returns it. |
short |
getUnsigned()
Reads one unsigned byte as a short integer.
|
short |
getUnsigned(int index)
Reads one byte as an unsigned short integer.
|
long |
getUnsignedInt()
Reads four bytes unsigned integer.
|
long |
getUnsignedInt(int index)
Reads four bytes unsigned integer.
|
int |
getUnsignedMediumInt()
Relative get method for reading an unsigned medium int value.
|
int |
getUnsignedMediumInt(int index)
Absolute get method for reading an unsigned medium int value.
|
int |
getUnsignedShort()
Reads two bytes unsigned integer.
|
int |
getUnsignedShort(int index)
Reads two bytes unsigned integer.
|
boolean |
hasArray() |
int |
hashCode() |
boolean |
hasRemaining() |
int |
indexOf(byte b)
Returns the first occurence position of the specified byte from the
current position to the current limit.
|
boolean |
isAutoExpand()
Returns true if and only if autoExpand is turned on.
|
boolean |
isAutoShrink()
Returns true if and only if autoShrink is turned on.
|
boolean |
isDerived()
returns true if and only if this buffer is derived from other
buffer via
IoBuffer.duplicate(), IoBuffer.slice() or
IoBuffer.asReadOnlyBuffer(). |
boolean |
isDirect() |
boolean |
isReadOnly() |
int |
limit() |
IoBuffer |
limit(int newLimit) |
IoBuffer |
mark() |
int |
markValue()
Returns the position of the current mark.
|
int |
minimumCapacity()
Returns the minimum capacity of this buffer which is used to determine
the new capacity of the buffer shrunk by
IoBuffer.compact() and
IoBuffer.shrink() operation. |
IoBuffer |
minimumCapacity(int minimumCapacity)
Sets the minimum capacity of this buffer which is used to determine the
new capacity of the buffer shrunk by
IoBuffer.compact() and
IoBuffer.shrink() operation. |
ByteOrder |
order() |
IoBuffer |
order(ByteOrder bo) |
int |
position() |
IoBuffer |
position(int newPosition) |
boolean |
prefixedDataAvailable(int prefixLength)
Returns true if this buffer contains a data which has a data
length as a prefix and the buffer has remaining data as enough as
specified in the data length field.
|
boolean |
prefixedDataAvailable(int prefixLength,
int maxDataLength)
Returns true if this buffer contains a data which has a data
length as a prefix and the buffer has remaining data as enough as
specified in the data length field.
|
IoBuffer |
put(byte b) |
IoBuffer |
put(byte[] src) |
IoBuffer |
put(byte[] src,
int offset,
int length) |
IoBuffer |
put(ByteBuffer src)
Writes the content of the specified src into this buffer.
|
IoBuffer |
put(int index,
byte b) |
IoBuffer |
put(IoBuffer src)
Writes the content of the specified src into this buffer.
|
IoBuffer |
putChar(char value) |
IoBuffer |
putChar(int index,
char value) |
IoBuffer |
putDouble(double value) |
IoBuffer |
putDouble(int index,
double value) |
IoBuffer |
putEnum(Enum<?> e)
Writes an enum's ordinal value to the buffer as a byte.
|
IoBuffer |
putEnum(int index,
Enum<?> e)
Writes an enum's ordinal value to the buffer as a byte.
|
IoBuffer |
putEnumInt(Enum<?> e)
Writes an enum's ordinal value to the buffer as an integer.
|
IoBuffer |
putEnumInt(int index,
Enum<?> e)
Writes an enum's ordinal value to the buffer as an integer.
|
<E extends Enum<E>> |
putEnumSet(int index,
Set<E> set)
Writes the specified
Set to the buffer as a byte sized bit
vector. |
<E extends Enum<E>> |
putEnumSet(Set<E> set)
Writes the specified
Set to the buffer as a byte sized bit
vector. |
<E extends Enum<E>> |
putEnumSetInt(int index,
Set<E> set)
Writes the specified
Set to the buffer as an int sized bit
vector. |
<E extends Enum<E>> |
putEnumSetInt(Set<E> set)
Writes the specified
Set to the buffer as an int sized bit
vector. |
<E extends Enum<E>> |
putEnumSetLong(int index,
Set<E> set)
Writes the specified
Set to the buffer as a long sized bit
vector. |
<E extends Enum<E>> |
putEnumSetLong(Set<E> set)
Writes the specified
Set to the buffer as a long sized bit
vector. |
<E extends Enum<E>> |
putEnumSetShort(int index,
Set<E> set)
Writes the specified
Set to the buffer as a short sized bit
vector. |
<E extends Enum<E>> |
putEnumSetShort(Set<E> set)
Writes the specified
Set to the buffer as a short sized bit
vector. |
IoBuffer |
putEnumShort(Enum<?> e)
Writes an enum's ordinal value to the buffer as a short.
|
IoBuffer |
putEnumShort(int index,
Enum<?> e)
Writes an enum's ordinal value to the buffer as a short.
|
IoBuffer |
putFloat(float value) |
IoBuffer |
putFloat(int index,
float value) |
IoBuffer |
putInt(int value) |
IoBuffer |
putInt(int index,
int value) |
IoBuffer |
putLong(int index,
long value) |
IoBuffer |
putLong(long value) |
IoBuffer |
putMediumInt(int value)
Relative put method for writing a medium int value.
|
IoBuffer |
putMediumInt(int index,
int value)
Absolute put method for writing a medium int value.
|
IoBuffer |
putObject(Object o)
Writes the specified Java object to the buffer.
|
IoBuffer |
putPrefixedString(CharSequence in,
CharsetEncoder encoder)
Writes the content of
in into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. |
IoBuffer |
putPrefixedString(CharSequence in,
int prefixLength,
CharsetEncoder encoder)
Writes the content of
in into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. |
IoBuffer |
putPrefixedString(CharSequence in,
int prefixLength,
int padding,
byte padValue,
CharsetEncoder encoder)
Writes the content of
in into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. |
IoBuffer |
putPrefixedString(CharSequence in,
int prefixLength,
int padding,
CharsetEncoder encoder)
Writes the content of
in into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. |
IoBuffer |
putShort(int index,
short value) |
IoBuffer |
putShort(short value) |
IoBuffer |
putString(CharSequence in,
CharsetEncoder encoder)
Writes the content of
in into this buffer using the
specified encoder. |
IoBuffer |
putString(CharSequence in,
int fieldSize,
CharsetEncoder encoder)
Writes the content of
in into this buffer as a
NUL-terminated string using the specified
encoder. |
int |
remaining() |
IoBuffer |
reset() |
IoBuffer |
rewind() |
IoBuffer |
setAutoExpand(boolean autoExpand)
Turns on or off autoExpand.
|
IoBuffer |
setAutoShrink(boolean autoShrink)
Turns on or off autoShrink.
|
IoBuffer |
shrink()
Changes the capacity of this buffer so this buffer occupies as less
memory as possible while retaining the position, limit and the buffer
content between the position and limit.
|
IoBuffer |
skip(int size)
Forwards the position of this buffer as the specified
size
bytes. |
IoBuffer |
slice() |
IoBuffer |
sweep()
Clears this buffer and fills its content with NUL.
|
IoBuffer |
sweep(byte value)
double Clears this buffer and fills its content with value.
|
String |
toString() |
allocate, allocate, getAllocator, isUseDirectBuffer, normalizeCapacity, setAllocator, setUseDirectBuffer, wrap, wrap, wrapprotected IoBufferWrapper(IoBuffer buf)
buf - the buffer to be proxiedpublic IoBuffer getParentBuffer()
public boolean isDirect()
isDirect 在类中 IoBufferByteBuffer.isDirect()public ByteBuffer buf()
IoBufferpublic int capacity()
capacity 在类中 IoBufferBuffer.capacity()public int position()
position 在类中 IoBufferBuffer.position()public IoBuffer position(int newPosition)
position 在类中 IoBufferBuffer.position(int)public int limit()
limit 在类中 IoBufferBuffer.limit()public IoBuffer limit(int newLimit)
limit 在类中 IoBufferBuffer.limit(int)public IoBuffer mark()
mark 在类中 IoBufferBuffer.mark()public IoBuffer reset()
reset 在类中 IoBufferBuffer.reset()public IoBuffer clear()
clear 在类中 IoBufferBuffer.clear()public IoBuffer sweep()
IoBufferpublic IoBuffer sweep(byte value)
IoBufferpublic IoBuffer flip()
flip 在类中 IoBufferBuffer.flip()public IoBuffer rewind()
rewind 在类中 IoBufferBuffer.rewind()public int remaining()
remaining 在类中 IoBufferBuffer.remaining()public boolean hasRemaining()
hasRemaining 在类中 IoBufferBuffer.hasRemaining()public byte get()
get 在类中 IoBufferByteBuffer.get()public short getUnsigned()
IoBuffergetUnsigned 在类中 IoBufferpublic IoBuffer put(byte b)
put 在类中 IoBufferByteBuffer.put(byte)public byte get(int index)
get 在类中 IoBufferByteBuffer.get(int)public short getUnsigned(int index)
IoBuffergetUnsigned 在类中 IoBufferpublic IoBuffer put(int index, byte b)
put 在类中 IoBufferByteBuffer.put(int, byte)public IoBuffer get(byte[] dst, int offset, int length)
get 在类中 IoBufferByteBuffer.get(byte[], int, int)public IoBuffer get(byte[] dst)
get 在类中 IoBufferByteBuffer.get(byte[])public IoBuffer put(IoBuffer src)
IoBufferpublic IoBuffer put(ByteBuffer src)
IoBufferpublic IoBuffer put(byte[] src, int offset, int length)
put 在类中 IoBufferByteBuffer.put(byte[], int, int)public IoBuffer put(byte[] src)
put 在类中 IoBufferByteBuffer.put(byte[])public IoBuffer compact()
compact 在类中 IoBufferByteBuffer.compact()public int compareTo(IoBuffer that)
public ByteOrder order()
order 在类中 IoBufferByteBuffer.order()public IoBuffer order(ByteOrder bo)
order 在类中 IoBufferByteBuffer.order(ByteOrder)public char getChar()
getChar 在类中 IoBufferByteBuffer.getChar()public IoBuffer putChar(char value)
putChar 在类中 IoBufferByteBuffer.putChar(char)public char getChar(int index)
getChar 在类中 IoBufferByteBuffer.getChar(int)public IoBuffer putChar(int index, char value)
putChar 在类中 IoBufferByteBuffer.putChar(int, char)public CharBuffer asCharBuffer()
asCharBuffer 在类中 IoBufferByteBuffer.asCharBuffer()public short getShort()
getShort 在类中 IoBufferByteBuffer.getShort()public int getUnsignedShort()
IoBuffergetUnsignedShort 在类中 IoBufferpublic IoBuffer putShort(short value)
putShort 在类中 IoBufferByteBuffer.putShort(short)public short getShort(int index)
getShort 在类中 IoBufferByteBuffer.getShort()public int getUnsignedShort(int index)
IoBuffergetUnsignedShort 在类中 IoBufferpublic IoBuffer putShort(int index, short value)
putShort 在类中 IoBufferByteBuffer.putShort(int, short)public ShortBuffer asShortBuffer()
asShortBuffer 在类中 IoBufferByteBuffer.asShortBuffer()public int getInt()
getInt 在类中 IoBufferByteBuffer.getInt()public long getUnsignedInt()
IoBuffergetUnsignedInt 在类中 IoBufferpublic IoBuffer putInt(int value)
putInt 在类中 IoBufferByteBuffer.putInt(int)public int getInt(int index)
getInt 在类中 IoBufferByteBuffer.getInt(int)public long getUnsignedInt(int index)
IoBuffergetUnsignedInt 在类中 IoBufferpublic IoBuffer putInt(int index, int value)
putInt 在类中 IoBufferByteBuffer.putInt(int, int)public IntBuffer asIntBuffer()
asIntBuffer 在类中 IoBufferByteBuffer.asIntBuffer()public long getLong()
getLong 在类中 IoBufferByteBuffer.getLong()public IoBuffer putLong(long value)
putLong 在类中 IoBufferByteBuffer.putLong(int, long)public long getLong(int index)
getLong 在类中 IoBufferByteBuffer.getLong(int)public IoBuffer putLong(int index, long value)
putLong 在类中 IoBufferByteBuffer.putLong(int, long)public LongBuffer asLongBuffer()
asLongBuffer 在类中 IoBufferByteBuffer.asLongBuffer()public float getFloat()
getFloat 在类中 IoBufferByteBuffer.getFloat()public IoBuffer putFloat(float value)
putFloat 在类中 IoBufferByteBuffer.putFloat(float)public float getFloat(int index)
getFloat 在类中 IoBufferByteBuffer.getFloat(int)public IoBuffer putFloat(int index, float value)
putFloat 在类中 IoBufferByteBuffer.putFloat(int, float)public FloatBuffer asFloatBuffer()
asFloatBuffer 在类中 IoBufferByteBuffer.asFloatBuffer()public double getDouble()
getDouble 在类中 IoBufferByteBuffer.getDouble()public IoBuffer putDouble(double value)
putDouble 在类中 IoBufferByteBuffer.putDouble(double)public double getDouble(int index)
getDouble 在类中 IoBufferByteBuffer.getDouble(int)public IoBuffer putDouble(int index, double value)
putDouble 在类中 IoBufferByteBuffer.putDouble(int, double)public DoubleBuffer asDoubleBuffer()
asDoubleBuffer 在类中 IoBufferByteBuffer.asDoubleBuffer()public String getHexDump()
IoBuffergetHexDump 在类中 IoBufferpublic String getString(int fieldSize, CharsetDecoder decoder) throws CharacterCodingException
IoBufferNUL-terminated string from this buffer using the
specified decoder and returns it.getString 在类中 IoBufferfieldSize - the maximum number of bytes to readCharacterCodingExceptionpublic String getString(CharsetDecoder decoder) throws CharacterCodingException
IoBufferNUL-terminated string from this buffer using the
specified decoder and returns it. This method reads until
the limit of this buffer if no NUL is found.getString 在类中 IoBufferCharacterCodingExceptionpublic String getPrefixedString(CharsetDecoder decoder) throws CharacterCodingException
IoBufferdecoder and returns it. This
method is a shortcut for getPrefixedString(2, decoder).getPrefixedString 在类中 IoBufferCharacterCodingExceptionpublic String getPrefixedString(int prefixLength, CharsetDecoder decoder) throws CharacterCodingException
IoBufferdecoder and returns it.getPrefixedString 在类中 IoBufferprefixLength - the length of the length field (1, 2, or 4)CharacterCodingExceptionpublic IoBuffer putString(CharSequence in, int fieldSize, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer as a
NUL-terminated string using the specified
encoder.
If the charset name of the encoder is UTF-16, you cannot specify odd
fieldSize, and this method will append two NULs
as a terminator.
Please note that this method doesn't terminate with NUL if
the input string is longer than fieldSize.
putString 在类中 IoBufferfieldSize - the maximum number of bytes to writeCharacterCodingExceptionpublic IoBuffer putString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer using the
specified encoder. This method doesn't terminate string with
NUL. You have to do it by yourself.putString 在类中 IoBufferCharacterCodingExceptionpublic IoBuffer putPrefixedString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. This method is a shortcut for
putPrefixedString(in, 2, 0, encoder).putPrefixedString 在类中 IoBufferCharacterCodingExceptionpublic IoBuffer putPrefixedString(CharSequence in, int prefixLength, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. This method is a shortcut for
putPrefixedString(in, prefixLength, 0, encoder).putPrefixedString 在类中 IoBufferprefixLength - the length of the length field (1, 2, or 4)CharacterCodingExceptionpublic IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder. This method is a shortcut for
putPrefixedString(in, prefixLength, padding, ( byte ) 0, encoder)
.putPrefixedString 在类中 IoBufferprefixLength - the length of the length field (1, 2, or 4)padding - the number of padded NULs (1 (or 0), 2, or 4)CharacterCodingExceptionpublic IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, byte padValue, CharsetEncoder encoder) throws CharacterCodingException
IoBufferin into this buffer as a string which
has a 16-bit length field before the actual encoded string, using the
specified encoder.putPrefixedString 在类中 IoBufferprefixLength - the length of the length field (1, 2, or 4)padding - the number of padded bytes (1 (or 0), 2, or 4)padValue - the value of padded bytesCharacterCodingExceptionpublic IoBuffer skip(int size)
IoBuffersize
bytes.public IoBuffer fill(byte value, int size)
IoBufferpublic IoBuffer fillAndReset(byte value, int size)
IoBufferfillAndReset 在类中 IoBufferpublic IoBuffer fill(int size)
IoBufferNUL (0x00). This method moves buffer
position forward.public IoBuffer fillAndReset(int size)
IoBufferNUL (0x00). This method does not
change buffer position.fillAndReset 在类中 IoBufferpublic boolean isAutoExpand()
IoBufferisAutoExpand 在类中 IoBufferpublic IoBuffer setAutoExpand(boolean autoExpand)
IoBuffersetAutoExpand 在类中 IoBufferpublic IoBuffer expand(int pos, int expectedRemaining)
IoBufferpublic IoBuffer expand(int expectedRemaining)
IoBufferpublic Object getObject() throws ClassNotFoundException
IoBufferClassLoader
of the current thread.getObject 在类中 IoBufferClassNotFoundExceptionpublic Object getObject(ClassLoader classLoader) throws ClassNotFoundException
IoBuffergetObject 在类中 IoBufferClassNotFoundExceptionpublic IoBuffer putObject(Object o)
IoBufferpublic InputStream asInputStream()
IoBufferInputStream that reads the data from this buffer.
InputStream.read() returns -1 if the buffer position
reaches to the limit.asInputStream 在类中 IoBufferpublic OutputStream asOutputStream()
IoBufferOutputStream that appends the data into this buffer.
Please note that the OutputStream.write(int) will throw a
BufferOverflowException instead of an IOException in case
of buffer overflow. Please set autoExpand property by calling
IoBuffer.setAutoExpand(boolean) to prevent the unexpected runtime
exception.asOutputStream 在类中 IoBufferpublic IoBuffer duplicate()
duplicate 在类中 IoBufferByteBuffer.duplicate()public IoBuffer slice()
slice 在类中 IoBufferByteBuffer.slice()public IoBuffer asReadOnlyBuffer()
asReadOnlyBuffer 在类中 IoBufferByteBuffer.asReadOnlyBuffer()public byte[] array()
array 在类中 IoBufferByteBuffer.array()public int arrayOffset()
arrayOffset 在类中 IoBufferByteBuffer.arrayOffset()public int minimumCapacity()
IoBufferIoBuffer.compact() and
IoBuffer.shrink() operation. The default value is the initial capacity of
the buffer.minimumCapacity 在类中 IoBufferpublic IoBuffer minimumCapacity(int minimumCapacity)
IoBufferIoBuffer.compact() and
IoBuffer.shrink() operation. The default value is the initial capacity of
the buffer.minimumCapacity 在类中 IoBufferpublic IoBuffer capacity(int newCapacity)
IoBufferpublic boolean isReadOnly()
isReadOnly 在类中 IoBufferBuffer.isReadOnly()public int markValue()
IoBufferpublic boolean hasArray()
hasArray 在类中 IoBufferByteBuffer.hasArray()public void free()
IoBufferIoBufferAllocator implementations.
It is not mandatory to call this method, but you might want to invoke
this method for maximum performance.public boolean isDerived()
IoBufferIoBuffer.duplicate(), IoBuffer.slice() or
IoBuffer.asReadOnlyBuffer().public boolean isAutoShrink()
IoBufferisAutoShrink 在类中 IoBufferpublic IoBuffer setAutoShrink(boolean autoShrink)
IoBuffersetAutoShrink 在类中 IoBufferpublic IoBuffer shrink()
IoBufferIoBuffer.minimumCapacity(). The mark is discarded once
the capacity changes.public int getMediumInt()
IoBufferReads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order, and then increments the position by three.
getMediumInt 在类中 IoBufferpublic int getUnsignedMediumInt()
IoBufferReads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order, and then increments the position by three.
getUnsignedMediumInt 在类中 IoBufferpublic int getMediumInt(int index)
IoBufferReads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order.
getMediumInt 在类中 IoBufferindex - The index from which the medium int will be readpublic int getUnsignedMediumInt(int index)
IoBufferReads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order.
getUnsignedMediumInt 在类中 IoBufferindex - The index from which the unsigned medium int will be readpublic IoBuffer putMediumInt(int value)
IoBufferWrites three bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by three.
putMediumInt 在类中 IoBuffervalue - The medium int value to be writtenpublic IoBuffer putMediumInt(int index, int value)
IoBufferWrites three bytes containing the given int value, in the current byte order, into this buffer at the given index.
putMediumInt 在类中 IoBufferindex - The index at which the bytes will be writtenvalue - The medium int value to be writtenpublic String getHexDump(int lengthLimit)
IoBuffergetHexDump 在类中 IoBufferlengthLimit - The maximum number of bytes to dump from the current buffer
position.public boolean prefixedDataAvailable(int prefixLength)
IoBufferIoBuffer.prefixedDataAvailable(int, int) instead.prefixedDataAvailable 在类中 IoBufferprefixLength - the length of the prefix field (1, 2, or 4)public boolean prefixedDataAvailable(int prefixLength,
int maxDataLength)
IoBufferprefixedDataAvailable 在类中 IoBufferprefixLength - the length of the prefix field (1, 2, or 4)maxDataLength - the allowed maximum of the read data lengthpublic int indexOf(byte b)
IoBufferpublic <E extends Enum<E>> E getEnum(Class<E> enumClass)
IoBufferpublic <E extends Enum<E>> E getEnum(int index, Class<E> enumClass)
IoBufferpublic <E extends Enum<E>> E getEnumShort(Class<E> enumClass)
IoBuffergetEnumShort 在类中 IoBufferE - The enum type to returnenumClass - The enum's class objectpublic <E extends Enum<E>> E getEnumShort(int index, Class<E> enumClass)
IoBuffergetEnumShort 在类中 IoBufferE - The enum type to returnindex - the index from which the bytes will be readenumClass - The enum's class objectpublic <E extends Enum<E>> E getEnumInt(Class<E> enumClass)
IoBuffergetEnumInt 在类中 IoBufferE - The enum type to returnenumClass - The enum's class objectpublic <E extends Enum<E>> E getEnumInt(int index, Class<E> enumClass)
IoBuffergetEnumInt 在类中 IoBufferE - The enum type to returnindex - the index from which the bytes will be readenumClass - The enum's class objectpublic IoBuffer putEnum(Enum<?> e)
IoBufferpublic IoBuffer putEnum(int index, Enum<?> e)
IoBufferpublic IoBuffer putEnumShort(Enum<?> e)
IoBufferputEnumShort 在类中 IoBuffere - The enum to write to the bufferpublic IoBuffer putEnumShort(int index, Enum<?> e)
IoBufferputEnumShort 在类中 IoBufferindex - The index at which the bytes will be writtene - The enum to write to the bufferpublic IoBuffer putEnumInt(Enum<?> e)
IoBufferputEnumInt 在类中 IoBuffere - The enum to write to the bufferpublic IoBuffer putEnumInt(int index, Enum<?> e)
IoBufferputEnumInt 在类中 IoBufferindex - The index at which the bytes will be writtene - The enum to write to the bufferpublic <E extends Enum<E>> EnumSet<E> getEnumSet(Class<E> enumClass)
IoBufferEnumSet.
Each bit is mapped to a value in the specified enum. The least significant bit maps to the first entry in the specified enum and each subsequent bit maps to each subsequent bit as mapped to the subsequent enum value.
getEnumSet 在类中 IoBufferE - the enum typeenumClass - the enum class used to create the EnumSetpublic <E extends Enum<E>> EnumSet<E> getEnumSet(int index, Class<E> enumClass)
IoBufferEnumSet.getEnumSet 在类中 IoBufferE - the enum typeindex - the index from which the byte will be readenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetShort(Class<E> enumClass)
IoBufferEnumSet.getEnumSetShort 在类中 IoBufferE - the enum typeenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetShort(int index, Class<E> enumClass)
IoBufferEnumSet.getEnumSetShort 在类中 IoBufferE - the enum typeindex - the index from which the bytes will be readenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetInt(Class<E> enumClass)
IoBufferEnumSet.getEnumSetInt 在类中 IoBufferE - the enum typeenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetInt(int index, Class<E> enumClass)
IoBufferEnumSet.getEnumSetInt 在类中 IoBufferE - the enum typeindex - the index from which the bytes will be readenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetLong(Class<E> enumClass)
IoBufferEnumSet.getEnumSetLong 在类中 IoBufferE - the enum typeenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> EnumSet<E> getEnumSetLong(int index, Class<E> enumClass)
IoBufferEnumSet.getEnumSetLong 在类中 IoBufferE - the enum typeindex - the index from which the bytes will be readenumClass - the enum class used to create the EnumSetIoBuffer.getEnumSet(Class)public <E extends Enum<E>> IoBuffer putEnumSet(Set<E> set)
IoBufferSet to the buffer as a byte sized bit
vector.putEnumSet 在类中 IoBufferE - the enum type of the Setset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSet(int index, Set<E> set)
IoBufferSet to the buffer as a byte sized bit
vector.putEnumSet 在类中 IoBufferE - the enum type of the Setindex - the index at which the byte will be writtenset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetShort(Set<E> set)
IoBufferSet to the buffer as a short sized bit
vector.putEnumSetShort 在类中 IoBufferE - the enum type of the Setset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetShort(int index, Set<E> set)
IoBufferSet to the buffer as a short sized bit
vector.putEnumSetShort 在类中 IoBufferE - the enum type of the Setindex - the index at which the bytes will be writtenset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetInt(Set<E> set)
IoBufferSet to the buffer as an int sized bit
vector.putEnumSetInt 在类中 IoBufferE - the enum type of the Setset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetInt(int index, Set<E> set)
IoBufferSet to the buffer as an int sized bit
vector.putEnumSetInt 在类中 IoBufferE - the enum type of the Setindex - the index at which the bytes will be writtenset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetLong(Set<E> set)
IoBufferSet to the buffer as a long sized bit
vector.putEnumSetLong 在类中 IoBufferE - the enum type of the Setset - the enum set to write to the bufferpublic <E extends Enum<E>> IoBuffer putEnumSetLong(int index, Set<E> set)
IoBufferSet to the buffer as a long sized bit
vector.putEnumSetLong 在类中 IoBufferE - the enum type of the Setindex - the index at which the bytes will be writtenset - the enum set to write to the bufferCopyright © 2013. All Rights Reserved.