public class GzipEncoder extends ZlibEncoder
ZlibCodec.Mode
deflater
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, removed
getInboundType, getOutboundType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInboundType, getOutboundType
public 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)
ZlibEncoder
deflateBound
in class ZlibEncoder
len
- the length of the uncompressed data.protected void preDeflate(ISession session, byte[] in, ByteBuffer out)
preDeflate
in class ZlibEncoder
session
- the session object the encoder is associated within
- the uncompressed input dataout
- the output bufferprotected void preFinish(ISession session, ByteBuffer out)
preFinish
in class ZlibEncoder
session
- the session object the encoder is associated without
- the output bufferprotected void postFinish(ISession session, ByteBuffer out)
postFinish
in class ZlibEncoder
session
- the session object the encoder is associated without
- the output bufferCopyright © 2017–2022 SNF4J.ORG. All rights reserved.