public class DirectByteBufferAllocator extends Object implements ByteBufferAllocator
| Constructor and Description |
|---|
DirectByteBufferAllocator() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocate(int size) |
static DirectByteBufferAllocator |
getInstance() |
boolean |
isDirect()
Indicates if this allocator will produce ByteBuffers backed by direct memory.
|
void |
release(ByteBuffer b)
For RefCounted implementations using direct memory, the release method
needs to be called to free references to the allocated memory.
|
public static final DirectByteBufferAllocator getInstance()
public ByteBuffer allocate(int size)
allocate in interface ByteBufferAllocatorpublic void release(ByteBuffer b)
ByteBufferAllocatorrelease in interface ByteBufferAllocatorb - a ByteBufferpublic boolean isDirect()
ByteBufferAllocatorisDirect in interface ByteBufferAllocatorCopyright © 2018 The Apache Software Foundation. All rights reserved.