Package org.jppf.utils.pooling
Class DirectBufferPool
java.lang.Object
org.jppf.utils.pooling.DirectBufferPool
Static factory for pool of direct byte buffers.
- Author:
- Laurent Cohen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferGet a buffer from the pool, or a new buffer if the pool is empty.static voidreleaseBuffer(ByteBuffer buffer) Release a buffer into the pool and make it available.
-
Constructor Details
-
DirectBufferPool
public DirectBufferPool()
-
-
Method Details
-
provideBuffer
Get a buffer from the pool, or a new buffer if the pool is empty.- Returns:
- a
ByteBufferinstance.
-
releaseBuffer
Release a buffer into the pool and make it available.- Parameters:
buffer- the buffer to release.
-