java.lang.Object
org.glassfish.grizzly.AbstractTransformer<Buffer,Buffer>
org.glassfish.grizzly.compression.zip.GZipEncoder
- All Implemented Interfaces:
Transformer<Buffer,Buffer>
This class implements a
Transformer which encodes plain data to the GZIP format.- Author:
- Alexey Stashok
-
Nested Class Summary
Nested ClassesNested 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
ConstructorsConstructorDescriptionGZipEncoder(int bufferSize) GZipEncoder(int bufferSize, int compressionLevel, int compressionStrategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected GZipEncoder.GZipOutputStateprotected Bufferdeflate(Deflater deflater, MemoryManager memoryManager) Writes next block of compressed data to the output stream.finish(AttributeStorage storage) Finishes to compress data to the output stream without closing the underlying stream.getName()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
-
Constructor Details
-
GZipEncoder
public GZipEncoder() -
GZipEncoder
public GZipEncoder(int bufferSize) -
GZipEncoder
public GZipEncoder(int bufferSize, int compressionLevel, int compressionStrategy)
-
-
Method Details
-
getName
Get the Transformer name. The name is used to store Transformer associated data.- Returns:
- The Transformer name.
-
hasInputRemaining
-
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
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
Writes next block of compressed data to the output stream.
-