Interface ByteBufferPool
-
- All Superinterfaces:
Service
- All Known Implementing Classes:
DefaultBufferPool,SimpleBufferPool
public interface ByteBufferPool extends Service
Represents a pool ofByteBufferinstances. This strategy could just create new buffers for each call or it could pool them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByteBufferborrowBuffer()Extract a buffer from the pool.voidreturnBuffer(ByteBuffer buffer)Returns the buffer to the pool or just discards it for a non-pool strategyvoidsetDefaultSize(int defaultSize)Sets the default size of the buffers
-
-
-
Method Detail
-
borrowBuffer
ByteBuffer borrowBuffer()
Extract a buffer from the pool.
-
returnBuffer
void returnBuffer(ByteBuffer buffer)
Returns the buffer to the pool or just discards it for a non-pool strategy
-
setDefaultSize
void setDefaultSize(int defaultSize)
Sets the default size of the buffers
-
-