Interface RetainableByteBufferPool

All Known Implementing Classes:
ArrayByteBufferPool.Retained, ArrayRetainableByteBufferPool, LogarithmicArrayByteBufferPool.LogarithmicRetainablePool, MappedByteBufferPool.Retained, RetainableByteBufferPool.NotRetainedByteBufferPool

public interface RetainableByteBufferPool

A RetainableByteBuffer pool.

Acquired buffers must be released by calling RetainableByteBuffer.release() otherwise the memory they hold will be leaked.

  • Method Details

    • acquire

      RetainableByteBuffer acquire(int size, boolean direct)
      Acquires a memory buffer from the pool.
      size - The size of the buffer. The returned buffer will have at least this capacity.
      direct - true if a direct memory buffer is needed, false otherwise.
      a memory buffer with position and size set to 0.
    • clear

      void clear()
    • from

      static RetainableByteBufferPool from(ByteBufferPool byteBufferPool)