Class Utf8StringDecoderPool

java.lang.Object
com.amazon.ion.impl.bin.utf8.Utf8StringDecoderPool

public class Utf8StringDecoderPool extends Object
A thread-safe shared pool of Utf8StringDecoders that can be used for UTF8 decoding.
  • Method Details

    • getInstance

      public static Utf8StringDecoderPool getInstance()
      Returns:
      a threadsafe shared instance of Utf8StringDecoderPool.
    • getOrCreate

      public Utf8StringDecoder getOrCreate()
      If the pool is not empty, removes an object from the pool and returns it; otherwise, constructs a new object.
      Returns:
      An object.
    • returnToPool

      public void returnToPool(Utf8StringDecoder object)
      Adds the provided instance to the pool. If the pool is full, the instance will be discarded. Callers MUST NOT use an object after returning it to the pool.
      Parameters:
      object - An object to add to the pool.