Package com.usatiuk.utils
Class UninitializedByteBuffer
java.lang.Object
com.usatiuk.utils.UninitializedByteBuffer
Utility class for creating uninitialized ByteBuffers, to avoid zeroing memory unnecessarily.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBuffer
allocate
(int capacity) Allocates a new uninitialized ByteBuffer of the specified capacity.static long
getAddress
(ByteBuffer buffer) Gets the address of the given ByteBuffer.
-
Constructor Details
-
UninitializedByteBuffer
public UninitializedByteBuffer()
-
-
Method Details
-
allocate
Allocates a new uninitialized ByteBuffer of the specified capacity.- Parameters:
capacity
- the capacity of the ByteBuffer- Returns:
- a new uninitialized ByteBuffer
-
getAddress
Gets the address of the given ByteBuffer.- Parameters:
buffer
- the ByteBuffer to get the address of- Returns:
- the address of the ByteBuffer
-