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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocate(int size) Allocate a direct ByteBuffer of the specified size.voiddestroyDirectBuffer(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:
destroyDirectBufferin interfaceBufferAllocator- Parameters:
toBeDestroyed- The direct buffer that will be "cleaned". Utilizes reflection.
-
allocate
Description copied from interface:BufferAllocatorAllocate a direct ByteBuffer of the specified size.- Specified by:
allocatein interfaceBufferAllocator- Parameters:
size- in bytes (≥0)- Returns:
- a new direct buffer
-