public class GzipEncoder extends ZlibEncoder
ZlibCodec.Modedeflater| Constructor and Description |
|---|
GzipEncoder()
Creates a new gzip encoder with the default compression level (
6). |
GzipEncoder(int level)
Creates a new gzip encoder with the specified compression level.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
deflateBound(int len)
Returns upper bound on the compressed size.
|
protected void |
postFinish(ISession session,
ByteBuffer out)
Generates the gzip footer.
|
protected void |
preDeflate(ISession session,
byte[] in,
ByteBuffer out)
Generates the gzip header.
|
protected void |
preFinish(ISession session,
ByteBuffer out)
Generates the gzip header if the compression was finished
without compressing any data.
|
added, encode, event, finish, isFinished, removedgetInboundType, getOutboundTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInboundType, getOutboundTypepublic GzipEncoder()
6).public GzipEncoder(int level)
level - the compression level (0 - 9). 1 yields
the fastest compression and 9 yields the best
compression. 0 means no compression. The default
compression level is 6.IllegalArgumentException - if the compression level is out of rangeprotected int deflateBound(int len)
ZlibEncoderdeflateBound in class ZlibEncoderlen - the length of the uncompressed data.protected void preDeflate(ISession session, byte[] in, ByteBuffer out)
preDeflate in class ZlibEncodersession - the session object the encoder is associated within - the uncompressed input dataout - the output bufferprotected void preFinish(ISession session, ByteBuffer out)
preFinish in class ZlibEncodersession - the session object the encoder is associated without - the output bufferprotected void postFinish(ISession session, ByteBuffer out)
postFinish in class ZlibEncodersession - the session object the encoder is associated without - the output bufferCopyright © 2017–2022 SNF4J.ORG. All rights reserved.