Class GZipEncoder
- java.lang.Object
-
- org.glassfish.grizzly.AbstractTransformer<Buffer,Buffer>
-
- org.glassfish.grizzly.compression.zip.GZipEncoder
-
- All Implemented Interfaces:
Transformer<Buffer,Buffer>
public class GZipEncoder extends AbstractTransformer<Buffer,Buffer>
This class implements aTransformerwhich encodes plain data to the GZIP format.- Author:
- Alexey Stashok
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classGZipEncoder.GZipOutputState-
Nested classes/interfaces inherited from class org.glassfish.grizzly.AbstractTransformer
AbstractTransformer.LastResultAwareState<K,L>
-
-
Field Summary
-
Fields inherited from class org.glassfish.grizzly.AbstractTransformer
attributeBuilder, stateAttr
-
-
Constructor Summary
Constructors Constructor Description GZipEncoder()GZipEncoder(int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GZipEncoder.GZipOutputStatecreateStateObject()protected Bufferdeflate(Deflater deflater, MemoryManager memoryManager)Writes next block of compressed data to the output stream.Bufferfinish(AttributeStorage storage)Finishes to compress data to the output stream without closing the underlying stream.StringgetName()Get the Transformer name.booleanhasInputRemaining(AttributeStorage storage, Buffer input)protected TransformationResult<Buffer,Buffer>transformImpl(AttributeStorage storage, Buffer input)-
Methods inherited from class org.glassfish.grizzly.AbstractTransformer
getLastResult, getMemoryManager, getNamePrefix, getValue, obtainMemoryManager, obtainStateObject, release, saveLastResult, setMemoryManager, transform
-
-
-
-
Method Detail
-
getName
public String getName()
Get the Transformer name. The name is used to store Transformer associated data.- Returns:
- The Transformer name.
-
hasInputRemaining
public boolean hasInputRemaining(AttributeStorage storage, Buffer input)
-
createStateObject
protected GZipEncoder.GZipOutputState createStateObject()
- Overrides:
createStateObjectin classAbstractTransformer<Buffer,Buffer>
-
transformImpl
protected TransformationResult<Buffer,Buffer> transformImpl(AttributeStorage storage, Buffer input) throws TransformationException
- Specified by:
transformImplin classAbstractTransformer<Buffer,Buffer>- Throws:
TransformationException
-
finish
public Buffer finish(AttributeStorage storage)
Finishes to compress data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.- Returns:
Bufferwith the last GZIP data to be sent.
-
deflate
protected Buffer deflate(Deflater deflater, MemoryManager memoryManager)
Writes next block of compressed data to the output stream.
-
-