org.jppf.utils.pooling
Class DirectBufferPool

java.lang.Object
  extended by org.jppf.utils.pooling.DirectBufferPool

public class DirectBufferPool
extends Object

Static factory for a pool of direct byte buffers.

Author:
Laurent Cohen

Constructor Summary
DirectBufferPool()
           
 
Method Summary
static ByteBuffer provideBuffer()
          Get a buffer from the pool, or a new buffer if the pool is empty.
static void releaseBuffer(ByteBuffer buffer)
          Release abuffer into the pool and make it available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectBufferPool

public DirectBufferPool()
Method Detail

provideBuffer

public static ByteBuffer provideBuffer()
Get a buffer from the pool, or a new buffer if the pool is empty.

Returns:
a ByteBuffer instance.

releaseBuffer

public static void releaseBuffer(ByteBuffer buffer)
Release abuffer into the pool and make it available.

Parameters:
buffer - the buffer to release.


Copyright © 2005-2010 JPPF Team.