Class PoolableByteBuffer

java.lang.Object
com.amazon.ion.impl.bin.utf8.PoolableByteBuffer
All Implemented Interfaces:
Closeable, AutoCloseable

public class PoolableByteBuffer extends Object
Holds a reusable ByteBuffer. Instances of this class are reusable but are NOT threadsafe. Instances are vended by Pool.getOrCreate(). Users are expected to call Closeable.close() when the decoder is no longer needed.
  • Method Details

    • getBuffer

      public ByteBuffer getBuffer()
      Returns:
      the buffer.
    • close

      public void close()
      Attempts to return this instance to the pool with which it is associated, if any. Do not continue to use this instance after calling this method.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable