public class UnsafeDirectBytes extends NativeBytes
| Modifier and Type | Method and Description |
|---|---|
static UnsafeDirectBytes |
allocate(int size)
Allocates a direct
ByteBuffer based byte array. |
UnsafeDirectBytes |
copy()
Copies the bytes to a new byte array.
|
close, isDirect, read, read, readByte, readChar, readDouble, readFloat, readInt, readLong, readMedium, readShort, readUnsignedMedium, resize, size, write, write, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writeShort, writeUnsignedMedium, zero, zero, zeroflush, isFile, order, order, readBoolean, readString, readString, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF8, writeBoolean, writeString, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUTF8public static UnsafeDirectBytes allocate(int size)
ByteBuffer based byte array.
When the array is constructed, DirectMemoryAllocator will be used to allocate
count bytes of off-heap memory. Memory is accessed by the buffer directly via Unsafe.
size - The count of the buffer to allocate (in bytes).IllegalArgumentException - If count is greater than the maximum allowed count for
a ByteBuffer - Integer.MAX_VALUE - 5public UnsafeDirectBytes copy()
UnsafeHeapBytes instance backed by a copy of this instance's array.Copyright © 2013–2018. All rights reserved.