Class CompressionPool<T>

    • Constructor Detail

      • CompressionPool

        public CompressionPool​(int capacity)
        Create a Pool of CompressionPool instances. If given a capacity equal to zero the Objects will not be pooled and will be created on acquire and ended on release. If given a negative capacity equal to zero there will be no size restrictions on the Pool
        capacity - maximum number of Objects which can be contained in the pool
    • Method Detail

      • newObject

        protected abstract T newObject()
      • end

        protected abstract void end​(T object)
      • reset

        protected abstract void reset​(T object)
      • acquire

        public T acquire()
        Object taken from the pool if it is not empty or a newly created Object
      • release

        public void release​(T object)
        object - returns this Object to the pool or calls end(Object) if the pool is full.