public class Buffer
extends java.lang.Object
| Constructor and Description |
|---|
Buffer() |
| Modifier and Type | Method and Description |
|---|---|
static long |
address(java.nio.ByteBuffer buf)
Returns the memory address of the ByteBuffer.
|
static java.nio.ByteBuffer |
calloc(int num,
int size)
Allocate a new ByteBuffer from memory and set all of the memory to 0
|
static java.nio.ByteBuffer |
create(long mem,
int size)
Allocate a new ByteBuffer from already allocated memory.
|
static void |
free(java.nio.ByteBuffer buf)
Deallocates or frees a memory block used by ByteBuffer
Warning : Call this method only on ByteBuffers that were created by calling Buffer.alloc or Buffer.calloc. |
static java.nio.ByteBuffer |
malloc(int size)
Allocate a new ByteBuffer from memory
|
static java.nio.ByteBuffer |
palloc(long p,
int size)
Allocate a new ByteBuffer from a pool
|
static java.nio.ByteBuffer |
pcalloc(long p,
int size)
Allocate a new ByteBuffer from a pool and set all of the memory to 0
|
static long |
size(java.nio.ByteBuffer buf)
Returns the allocated memory size of the ByteBuffer.
|
public static java.nio.ByteBuffer malloc(int size)
size - The amount of memory to allocatepublic static java.nio.ByteBuffer calloc(int num,
int size)
num - Number of elements.size - Length in bytes of each element.public static java.nio.ByteBuffer palloc(long p,
int size)
p - The pool to allocate fromsize - The amount of memory to allocatepublic static java.nio.ByteBuffer pcalloc(long p,
int size)
p - The pool to allocate fromsize - The amount of memory to allocatepublic static java.nio.ByteBuffer create(long mem,
int size)
mem - The memory to usesize - The amount of memory to usepublic static void free(java.nio.ByteBuffer buf)
buf - Previously allocated ByteBuffer to be freed.public static long address(java.nio.ByteBuffer buf)
buf - Previously allocated ByteBuffer.public static long size(java.nio.ByteBuffer buf)
buf - Previously allocated ByteBuffer.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.