Class DirectBufferPool

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

public class DirectBufferPool extends Object
Static factory for pool of direct byte buffers.
Author:
Laurent Cohen
  • Constructor Details

    • DirectBufferPool

      public DirectBufferPool()
  • Method Details

    • 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 a buffer into the pool and make it available.
      Parameters:
      buffer - the buffer to release.