public final class BufferUtils extends Object
BufferUtils is a helper class for generating nio buffers from
jME data classes such as Vectors and ColorRGBA.| Constructor and Description |
|---|
BufferUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Buffer |
clone(Buffer buf)
Creates a clone of the given buffer.
|
static ByteBuffer |
createByteBuffer(int size)
Create a new ByteBuffer of the specified size.
|
static void |
destroyDirectBuffer(Buffer toBeDestroyed)
Direct buffers are garbage collected by using a phantom reference and a
reference queue.
|
static void |
printCurrentDirectMemory(StringBuilder store) |
static void |
setTrackDirectMemoryEnabled(boolean enabled)
Set it to true if you want to enable direct memory tracking for debugging purpose.
|
public static void setTrackDirectMemoryEnabled(boolean enabled)
enabled - public static Buffer clone(Buffer buf)
buf - The buffer to clonepublic static void printCurrentDirectMemory(StringBuilder store)
public static ByteBuffer createByteBuffer(int size)
size - required number of ints to store.public static void destroyDirectBuffer(Buffer toBeDestroyed)
toBeDestroyed - The direct buffer that will be "cleaned". Utilizes reflection.Copyright © 2016 Java Graphics Society. All rights reserved.