public class DirectBuffer extends NativeBuffer
ByteBuffer based buffer.| Modifier and Type | Method and Description |
|---|---|
static DirectBuffer |
allocate()
Allocates a direct buffer with an initial capacity of
4096 and a maximum capacity of Long.MAX_VALUE. |
static DirectBuffer |
allocate(long initialCapacity)
Allocates a direct buffer with the given initial capacity.
|
static DirectBuffer |
allocate(long initialCapacity,
long maxCapacity)
Allocates a new direct 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, 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, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedMedium, writeUnsignedMedium, writeUnsignedShort, writeUnsignedShort, writeUTF8, writeUTF8, zero, zero, zeropublic static DirectBuffer 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 DirectBytes will be initialized to the next power of 2.
allocate(long),
allocate(long, long)public static DirectBuffer allocate(long 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 DirectBytes 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(long, long)public static DirectBuffer allocate(long initialCapacity, long 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 DirectBytes
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(long)Copyright © 2013–2015. All rights reserved.