public class DeflaterPool extends CompressionPool<java.util.zip.Deflater>
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
private int |
compressionLevel |
private boolean |
nowrap |
INFINITE_CAPACITY
Constructor and Description |
---|
DeflaterPool(int capacity,
int compressionLevel,
boolean nowrap)
Create a Pool of
Deflater instances. |
Modifier and Type | Method and Description |
---|---|
protected void |
end(java.util.zip.Deflater deflater) |
protected java.util.zip.Deflater |
newObject() |
protected void |
reset(java.util.zip.Deflater deflater) |
acquire, doStop, release
addLifeCycleListener, doStart, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
private final int compressionLevel
private final boolean nowrap
public DeflaterPool(int capacity, int compressionLevel, boolean nowrap)
Deflater
instances.
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
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 objectsprotected java.util.zip.Deflater newObject()
newObject
in class CompressionPool<java.util.zip.Deflater>
protected void end(java.util.zip.Deflater deflater)
end
in class CompressionPool<java.util.zip.Deflater>
protected void reset(java.util.zip.Deflater deflater)
reset
in class CompressionPool<java.util.zip.Deflater>