Class ByteBufferPool.Sized

java.lang.Object
org.eclipse.jetty.io.ByteBufferPool.Wrapper
org.eclipse.jetty.io.ByteBufferPool.Sized
All Implemented Interfaces:
ByteBufferPool
Enclosing interface:
ByteBufferPool

public static class ByteBufferPool.Sized extends ByteBufferPool.Wrapper
A ByteBufferPool with an additional no-args acquire() method to obtain a buffer of a preconfigured specific size and type.
  • Constructor Details

    • Sized

      public Sized(ByteBufferPool wrapped)
      Create a sized pool for non direct buffers of a default size from a wrapped pool.
      Parameters:
      wrapped - The actual ByteBufferPool
    • Sized

      public Sized(ByteBufferPool wrapped, boolean direct, int size)
      Create a sized pool for a give directness and size from a wrapped pool.
      Parameters:
      wrapped - The actual ByteBufferPool
      direct - true for direct buffers.
      size - The specified size in bytes of the buffer, or -1 for a default
  • Method Details

    • isDirect

      public boolean isDirect()
    • getSize

      public int getSize()
    • acquire

      public RetainableByteBuffer acquire()
      Returns:
      A RetainableByteBuffer suitable for the specified preconfigured size and type.