Interface BufferPool

All Known Implementing Classes:
BufferPoolImpl

public interface BufferPool
char[] pool that pool instances of char[] which are expensive to create.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    recycle(char[] buf)
    Returns an object back to the pool.
    char[]
    Gets a new char[] object from the pool.
  • Method Details

    • take

      char[] take()
      Gets a new char[] object from the pool.

      If no object is available in the pool, this method creates a new one.

      Returns:
      always non-null.
    • recycle

      void recycle(char[] buf)
      Returns an object back to the pool.
      Parameters:
      buf - object to return back to the pool