Class BufferPool


  • public class BufferPool
    extends java.lang.Object
    • Field Detail

      • DEFAULT_POOL_SIZE

        public static final int DEFAULT_POOL_SIZE
      • instance

        protected static volatile BufferPool instance
      • maxSize

        protected int maxSize
      • size

        protected final java.util.concurrent.atomic.AtomicInteger size
      • queue

        protected final java.util.concurrent.ConcurrentLinkedQueue<XByteBuffer> queue
    • Method Detail

      • getBufferPool

        public static BufferPool getBufferPool()
      • getBuffer

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

        public void returnBuffer​(XByteBuffer buffer)
      • clear

        public void clear()
      • setMaxSize

        public void setMaxSize​(int bytes)
      • getMaxSize

        public int getMaxSize()