Class UninitializedByteBuffer

java.lang.Object
com.usatiuk.utils.UninitializedByteBuffer

public class UninitializedByteBuffer extends Object
Utility class for creating uninitialized ByteBuffers, to avoid zeroing memory unnecessarily.
  • Constructor Details

    • UninitializedByteBuffer

      public UninitializedByteBuffer()
  • Method Details

    • allocate

      public static ByteBuffer allocate(int capacity)
      Allocates a new uninitialized ByteBuffer of the specified capacity.
      Parameters:
      capacity - the capacity of the ByteBuffer
      Returns:
      a new uninitialized ByteBuffer
    • getAddress

      public static long getAddress(ByteBuffer buffer)
      Gets the address of the given ByteBuffer.
      Parameters:
      buffer - the ByteBuffer to get the address of
      Returns:
      the address of the ByteBuffer