public class DirectBytes extends NativeBytes
| Modifier and Type | Method and Description |
|---|---|
static DirectBytes |
allocate(long size)
Allocates a direct
ByteBuffer based byte array. |
DirectBytes |
copy()
Copies the bytes to a new byte array.
|
close, flush, isDirect, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLong, readMedium, readShort, readString, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, readUTF8, resize, size, write, write, writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writeShort, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedMedium, writeUnsignedShort, writeUTF8, zero, zero, zeroisFile, order, orderpublic static DirectBytes allocate(long 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 DirectBytes copy()
HeapBytes instance backed by a copy of this instance's array.Copyright © 2013–2015. All rights reserved.