Package com.jme3.util
Class ReflectionAllocator
java.lang.Object
com.jme3.util.ReflectionAllocator
- All Implemented Interfaces:
BufferAllocator
This class contains the reflection based way to remove DirectByteBuffers in
java, allocation is done via ByteBuffer.allocateDirect
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocate
(int size) Allocate a direct ByteBuffer of the specified size.void
destroyDirectBuffer
(Buffer toBeDestroyed) This function explicitly calls the Cleaner method of a direct buffer.
-
Constructor Details
-
ReflectionAllocator
public ReflectionAllocator()
-
-
Method Details
-
destroyDirectBuffer
This function explicitly calls the Cleaner method of a direct buffer.- Specified by:
destroyDirectBuffer
in interfaceBufferAllocator
- Parameters:
toBeDestroyed
- The direct buffer that will be "cleaned". Utilizes reflection.
-
allocate
Description copied from interface:BufferAllocator
Allocate a direct ByteBuffer of the specified size.- Specified by:
allocate
in interfaceBufferAllocator
- Parameters:
size
- in bytes (≥0)- Returns:
- a new direct buffer
-