-
- All Known Implementing Classes:
ArrayRetainableByteBufferPool
public interface RetainableByteBufferPoolA
RetainableByteBufferpool.Acquired buffers must be released by calling
RetainableByteBuffer.release()otherwise the memory they hold will be leaked.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description RetainableByteBufferacquire(int size, boolean direct)Acquires a memory buffer from the pool.static RetainableByteBufferPoolfindOrAdapt(org.eclipse.jetty.util.component.Container container, ByteBufferPool byteBufferPool)Finds aRetainableByteBufferPoolimplementation in the given container, or wrap the givenByteBufferPoolwith an adapter.
-
-
-
Method Detail
-
acquire
RetainableByteBuffer acquire(int size, boolean direct)
Acquires a memory buffer from the pool.- Parameters:
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.- Returns:
- a memory buffer.
-
findOrAdapt
static RetainableByteBufferPool findOrAdapt(org.eclipse.jetty.util.component.Container container, ByteBufferPool byteBufferPool)
Finds aRetainableByteBufferPoolimplementation in the given container, or wrap the givenByteBufferPoolwith an adapter.- Parameters:
container- the container to search for an existing memory pool.byteBufferPool- theByteBufferPoolto wrap if no memory pool was found in the container.- Returns:
- the
RetainableByteBufferPoolfound or the wrapped one.
-
-