public class UnsafeDirectBuffer extends NativeBuffer
ByteBuffer based buffer.| Modifier and Type | Method and Description |
|---|---|
static UnsafeDirectBuffer |
allocate()
Allocates a direct buffer with an initial capacity of
4096 and a maximum capacity of Long.MAX_VALUE. |
static UnsafeDirectBuffer |
allocate(int initialCapacity)
Allocates a direct buffer with the given initial capacity.
|
static UnsafeDirectBuffer |
allocate(int initialCapacity,
int maxCapacity)
Allocates a new direct buffer.
|
UnsafeDirectBuffer |
duplicate()
Returns a duplicate of the buffer.
|
acquire, asReadOnlyBuffer, bytes, capacity, capacity, clear, close, compact, flip, flush, hasRemaining, isDirect, isFile, isReadOnly, limit, limit, mark, maxCapacity, offset, order, order, position, position, read, read, read, read, read, read, read, readBoolean, readBoolean, readByte, readByte, readChar, readChar, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLong, readLong, readMedium, readMedium, readShort, readShort, readString, readString, readString, readString, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedMedium, readUnsignedMedium, readUnsignedShort, readUnsignedShort, readUTF8, readUTF8, references, release, remaining, reset, rewind, skip, slice, slice, slice, write, write, write, write, write, write, write, writeBoolean, writeBoolean, writeByte, writeByte, writeChar, writeChar, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLong, writeLong, writeMedium, writeMedium, writeShort, writeShort, writeString, writeString, writeString, writeString, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedMedium, writeUnsignedMedium, writeUnsignedShort, writeUnsignedShort, writeUTF8, writeUTF8, zero, zero, zeroequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadByteswriteBytespublic static UnsafeDirectBuffer allocate()
4096 and a maximum capacity of Long.MAX_VALUE.
When the buffer is constructed, DirectMemoryAllocator will be used to allocate
capacity bytes of off-heap memory. The resulting buffer will be initialized with a capacity of 4096
and have a maximum capacity of Long.MAX_VALUE. The buffer's capacity will dynamically expand as
bytes are written to the buffer. The underlying UnsafeDirectBytes will be initialized to the next power of 2.
allocate(int),
allocate(int, int)public static UnsafeDirectBuffer allocate(int initialCapacity)
When the buffer is constructed, DirectMemoryAllocator will be used to allocate
capacity bytes of off-heap memory. The resulting buffer will have an initial capacity of capacity.
The underlying UnsafeDirectBytes will be initialized to the next power of 2.
initialCapacity - The initial capacity of the buffer to allocate (in bytes).IllegalArgumentException - If capacity is greater than the maximum allowed count for
a ByteBuffer - Integer.MAX_VALUE - 5allocate(),
allocate(int, int)public static UnsafeDirectBuffer allocate(int initialCapacity, int maxCapacity)
When the buffer is constructed, DirectMemoryAllocator will be used to allocate
capacity bytes of off-heap memory. The resulting buffer will have an initial capacity of initialCapacity
and will be doubled up to maxCapacity as bytes are written to the buffer. The underlying UnsafeDirectBytes
will be initialized to the next power of 2.
initialCapacity - The initial capacity of the buffer to allocate (in bytes).maxCapacity - The maximum capacity of the buffer.IllegalArgumentException - If capacity or maxCapacity is greater than the maximum
allowed count for a ByteBuffer - Integer.MAX_VALUE - 5allocate(),
allocate(int)public UnsafeDirectBuffer duplicate()
BufferCopyright © 2013–2018. All rights reserved.