Package org.eclipse.jetty.io
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.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
-
Method Summary
Modifier and TypeMethodDescriptionacquire
(int size, boolean direct) Acquires a memory buffer from the pool.void
clear()
static RetainableByteBufferPool
from
(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
-