Module jakarta.json

Interface BufferPool


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void recycle​(char[] buf)
      Returns an object back to the pool.
      char[] take()
      Gets a new char[] object from the pool.
    • Method Detail

      • 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