Package org.eclipse.jetty.server
Class DeflaterPool
- java.lang.Object
-
- org.eclipse.jetty.server.DeflaterPool
-
public class DeflaterPool extends Object
-
-
Constructor Summary
Constructors Constructor Description DeflaterPool(int capacity, int compressionLevel, boolean nowrap)Create a Pool ofDeflaterinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Deflateracquire()protected DeflaternewDeflater()voidrelease(Deflater deflater)
-
-
-
Constructor Detail
-
DeflaterPool
public DeflaterPool(int capacity, int compressionLevel, boolean nowrap)Create a Pool ofDeflaterinstances. If given a capacity equal to zero the Deflaters 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 DeflaterPool- Parameters:
capacity- maximum number of Deflaters which can be contained in the poolcompressionLevel- the default compression level for new Deflater objectsnowrap- if true then use GZIP compatible compression for all new Deflater objects
-
-
Method Detail
-
newDeflater
protected Deflater newDeflater()
-
acquire
public Deflater acquire()
- Returns:
- Deflater taken from the pool if it is not empty or a newly created Deflater
-
release
public void release(Deflater deflater)
- Parameters:
deflater- returns this Deflater to the pool or calls deflater.end() if the pool is full.
-
-