org.glassfish.grizzly.compression.zip
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 a Transformer
which encodes plain data to
the GZIP format.
- Author:
- Alexey Stashok
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GZipEncoder
public GZipEncoder()
GZipEncoder
public GZipEncoder(int bufferSize)
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:
createStateObject
in class AbstractTransformer<Buffer,Buffer>
transformImpl
protected TransformationResult<Buffer,Buffer> transformImpl(AttributeStorage storage,
Buffer input)
throws TransformationException
-
- Specified by:
transformImpl
in class AbstractTransformer<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:
Buffer
with 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.
Copyright © 2012 Oracle Corporation. All Rights Reserved.