Package org.eclipse.jetty.io
Interface RetainableByteBufferPool
- All Known Implementing Classes:
ArrayByteBufferPool.Retained,ArrayRetainableByteBufferPool,ArrayRetainableByteBufferPool.Tracking,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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionacquire(int size, boolean direct) Acquires a memory buffer from the pool.voidclear()static RetainableByteBufferPoolfrom(ByteBufferPool byteBufferPool)
-
Method Details
-
acquire
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 with position and size set to 0.
-
clear
void clear() -
from
-