@NotThreadSafe public final class MutableBuffer extends PowerBuffer<MutableBuffer>
ByteBuffer, so you can use
a MutableBuffer wherever you would otherwise use a
ByteBuffer.
However, unlike the ByteBuffer class, a clone of a
MutableBuffer always inherits the original buffer's byte order,
e.g. when calling slice(), duplicate() or
asReadOnlyBuffer().asImmutableBuffer()| Modifier and Type | Method and Description |
|---|---|
static MutableBuffer |
allocate(int capacity) |
static MutableBuffer |
allocateDirect(int capacity) |
ImmutableBuffer |
asImmutableBuffer()
Returns an immutable buffer view of the adapted byte buffer.
|
MutableBuffer |
asMutableBuffer()
Returns a mutable buffer view of the adapted byte buffer.
|
MutableBuffer |
asReadOnlyBuffer() |
MutableBuffer |
duplicate() |
boolean |
isMutable()
Returns
true if and only if this power buffer is mutable. |
MutableBuffer |
slice() |
static MutableBuffer |
wrap(byte[] array) |
static MutableBuffer |
wrap(byte[] array,
int offset,
int length) |
static MutableBuffer |
wrap(ByteBuffer buf)
Constructs a new mutable buffer which adapts the given byte
buffer. |
array, arrayOffset, asCharBuffer, asDoubleBuffer, asFloatBuffer, asIntBuffer, asLongBuffer, asShortBuffer, bigEndian, buffer, capacity, clear, clone, compact, compareTo, equals, flip, get, get, get, get, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getUByte, getUByte, getUInt, getUInt, getUShort, getUShort, hasArray, hashCode, hasRemaining, isDirect, isReadOnly, limit, limit, littleEndian, load, mark, order, order, position, position, put, put, put, put, put, put, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, remaining, reset, rewind, save, skip, toStringpublic static MutableBuffer allocate(int capacity)
ByteBuffer.allocate(int)public static MutableBuffer allocateDirect(int capacity)
ByteBuffer.allocateDirect(int)public ImmutableBuffer asImmutableBuffer()
PowerBufferPowerBuffer.order().asImmutableBuffer in class PowerBuffer<MutableBuffer>public MutableBuffer asMutableBuffer()
PowerBufferPowerBuffer.order().asMutableBuffer in class PowerBuffer<MutableBuffer>public MutableBuffer asReadOnlyBuffer()
asReadOnlyBuffer in class PowerBuffer<MutableBuffer>ByteBuffer.asReadOnlyBuffer()public MutableBuffer duplicate()
duplicate in class PowerBuffer<MutableBuffer>ByteBuffer.duplicate()public boolean isMutable()
PowerBuffertrue if and only if this power buffer is mutable.isMutable in class PowerBuffer<MutableBuffer>public MutableBuffer slice()
slice in class PowerBuffer<MutableBuffer>ByteBuffer.slice()public static MutableBuffer wrap(byte[] array)
ByteBuffer.wrap(byte[])public static MutableBuffer wrap(byte[] array, int offset, int length)
ByteBuffer.wrap(byte[], int, int)public static MutableBuffer wrap(ByteBuffer buf)
buffer.buf - the byte buffer to adapt.Copyright © 2012–2014 Schlichtherle IT Services. All rights reserved.