Interface ByteBufferAllocator

All Known Implementing Classes:
PooledByteBufferAllocator, SimpleByteBufferAllocator

public interface ByteBufferAllocator
Allocates ByteBuffers and manages them. Please implement this interface if you need more advanced memory management scheme.
  • Method Summary

    Modifier and Type
    Method
    Description
    allocate(int capacity, boolean direct)
    Returns the buffer which is capable of the specified size.
    void
    Dispose of this allocator.
    wrap(ByteBuffer nioBuffer)
    Wraps the specified NIO ByteBuffer into MINA buffer.
  • Method Details

    • allocate

      ByteBuffer allocate(int capacity, boolean direct)
      Returns the buffer which is capable of the specified size.
      Parameters:
      capacity - the capacity of the buffer
      direct - true to get a direct buffer, false to get a heap buffer.
    • wrap

      ByteBuffer wrap(ByteBuffer nioBuffer)
      Wraps the specified NIO ByteBuffer into MINA buffer.
    • dispose

      void dispose()
      Dispose of this allocator.