Class BufferPool


  • public class BufferPool
    extends java.lang.Object
    Pool for reusing byte buffers in Tribes messaging.
    • Field Detail

      • DEFAULT_POOL_SIZE

        public static final int DEFAULT_POOL_SIZE
        Default maximum pool size in bytes (100 MiB).
        See Also:
        Constant Field Values
      • sm

        protected static final StringManager sm
        String manager for internationalized messages.
      • instance

        protected static volatile BufferPool instance
        Singleton instance of the buffer pool.
    • Method Detail

      • getBuffer

        public XByteBuffer getBuffer​(int minSize,
                                     boolean discard)
      • returnBuffer

        public void returnBuffer​(XByteBuffer buffer)
      • clear

        public void clear()
      • getBufferPool

        public static BufferPool getBufferPool()
        Returns the singleton buffer pool instance.
        Returns:
        the buffer pool