public final class LongByteBuffers extends Object
Utility class for working with LongByteBuffer
| Modifier and Type | Method and Description |
|---|---|
static LongByteBuffer |
dynamicHeap() |
static LongByteBuffer |
dynamicHeap(long theSize) |
static LongByteBuffer |
empty()
Return an empty buffer
|
static MemoryLongByteBuffer |
heap(byte[] theBuffer) |
static MemoryLongByteBuffer |
heap(long theSize) |
static OffHeapLongByteBuffer |
offHeap(long theLength)
Allocate new
LongByteBuffer backed by unsafe from the system memory pool. |
static OffHeapLongByteBuffer |
offHeap(MemoryPool thePool,
long theLength)
Allocate a new
LongByteBuffer backed by unsafe. |
static OffHeapLongByteBuffer |
offHeap(MemoryPool thePool,
long theLength,
boolean theChecked)
Allocate a new
LongByteBuffer backed by unsafe. |
static OffHeapLongByteBuffer |
offHeap(MemoryPool thePool,
long theAddress,
long theLength) |
static OffHeapLongByteBuffer |
offHeap(MemoryPool thePool,
long theAddress,
long theLength,
boolean theChecked) |
static byte[] |
toByteArray(LongByteBuffer theBuffer)
Copy the buffer to a byte array
|
public static LongByteBuffer empty()
public static byte[] toByteArray(LongByteBuffer theBuffer)
theBuffer - the buffer to copypublic static LongByteBuffer dynamicHeap()
public static LongByteBuffer dynamicHeap(long theSize)
public static MemoryLongByteBuffer heap(long theSize)
public static MemoryLongByteBuffer heap(byte[] theBuffer)
public static OffHeapLongByteBuffer offHeap(long theLength)
LongByteBuffer backed by unsafe from the system memory pool.theLength - the size of the new bufferpublic static OffHeapLongByteBuffer offHeap(MemoryPool thePool, long theLength)
LongByteBuffer backed by unsafe.thePool - the pool to allocate fromtheLength - the size of the bufferNotEnoughMemoryException - if the buffer cannot be allocatedIllegalStateException - if Unsafe is not available on the systempublic static OffHeapLongByteBuffer offHeap(MemoryPool thePool, long theLength, boolean theChecked)
LongByteBuffer backed by unsafe.thePool - the pool to allocate fromtheLength - the size of the buffertheChecked - whether or not the buffer should perform bounds checks. unchecked buffers are faster, but
even more unsafe than a checked unsafe buffer. Use only in situations where bounds are
already checked.NotEnoughMemoryException - if the buffer cannot be allocatedIllegalStateException - if Unsafe is not available on the systempublic static OffHeapLongByteBuffer offHeap(MemoryPool thePool, long theAddress, long theLength)
public static OffHeapLongByteBuffer offHeap(MemoryPool thePool, long theAddress, long theLength, boolean theChecked)
Copyright © 2010-2016 Stardog Union. All Rights Reserved.