Class PoolableByteBuffer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class PoolableByteBuffer
    extends java.lang.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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Attempts to return this instance to the pool with which it is associated, if any.
      java.nio.ByteBuffer getBuffer()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getBuffer

        public java.nio.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 java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable