Interface ByteBufferAllocator

All Known Implementing Classes:
DirectByteBufferAllocator, HeapByteBufferAllocator, ReusingByteBufferAllocator, TrackingByteBufferAllocator

public interface ByteBufferAllocator
  • Method Summary

    Modifier and Type
    Method
    Description
    allocate(int size)
     
    boolean
    Indicates if this allocator will produce ByteBuffers backed by direct memory.
    void
    For RefCounted implementations using direct memory, the release method needs to be called to free references to the allocated memory.
  • Method Details

    • allocate

      ByteBuffer allocate(int size)
    • release

      void release(ByteBuffer b)
      For RefCounted implementations using direct memory, the release method needs to be called to free references to the allocated memory.
      Parameters:
      b - a ByteBuffer
    • isDirect

      boolean isDirect()
      Indicates if this allocator will produce ByteBuffers backed by direct memory.
      Returns:
      true if direct memory backed buffers will be created by this allocator, else false