|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.channel.SimpleChannelHandler
org.jboss.netty.handler.codec.http2.HttpContentEncoder
org.jboss.netty.handler.codec.http2.HttpContentCompressor
public class HttpContentCompressor

Compresses an HttpMessage and an HttpChunk in gzip or
deflate encoding while respecting the "Accept-Encoding" header.
If there is no matching encoding, no compression is done. For more
information on how this handler modifies the message, please refer to
HttpContentEncoder.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
|---|
org.jboss.netty.channel.ChannelHandler.Sharable |
| Constructor Summary | |
|---|---|
HttpContentCompressor()
Creates a new handler with the default compression level (6), default window size (15) and default memory level (8). |
|
HttpContentCompressor(int compressionLevel)
Creates a new handler with the specified compression level, default window size (15) and default memory level (8). |
|
HttpContentCompressor(int compressionLevel,
int windowBits,
int memLevel)
Creates a new handler with the specified compression level, window size, and memory level.. |
|
| Method Summary | |
|---|---|
protected String |
getTargetContentEncoding(String acceptEncoding)
Returns the expected content encoding of the encoded content. |
protected org.jboss.netty.handler.codec.embedder.EncoderEmbedder<org.jboss.netty.buffer.ChannelBuffer> |
newContentEncoder(String acceptEncoding)
Returns a new EncoderEmbedder that encodes the HTTP message
content. |
| Methods inherited from class org.jboss.netty.handler.codec.http2.HttpContentEncoder |
|---|
messageReceived, writeRequested |
| Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler |
|---|
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, exceptionCaught, handleDownstream, handleUpstream, setInterestOpsRequested, unbindRequested, writeComplete |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpContentCompressor()
public HttpContentCompressor(int compressionLevel)
compressionLevel - 1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.
public HttpContentCompressor(int compressionLevel,
int windowBits,
int memLevel)
compressionLevel - 1 yields the fastest compression and 9 yields the
best compression. 0 means no compression. The default
compression level is 6.windowBits - The base two logarithm of the size of the history buffer. The
value should be in the range 9 to 15 inclusive.
Larger values result in better compression at the expense of
memory usage. The default value is 15.memLevel - How much memory should be allocated for the internal compression
state. 1 uses minimum memory and 9 uses maximum
memory. Larger values result in better and faster compression
at the expense of memory usage. The default value is 8| Method Detail |
|---|
protected org.jboss.netty.handler.codec.embedder.EncoderEmbedder<org.jboss.netty.buffer.ChannelBuffer> newContentEncoder(String acceptEncoding)
throws Exception
HttpContentEncoderEncoderEmbedder that encodes the HTTP message
content.
newContentEncoder in class HttpContentEncoderacceptEncoding - the value of the "Accept-Encoding" header
EncoderEmbedder if there is a supported encoding
in acceptEncoding. null otherwise.
Exception
protected String getTargetContentEncoding(String acceptEncoding)
throws Exception
HttpContentEncoder
getTargetContentEncoding in class HttpContentEncoderacceptEncoding - the value of the "Accept-Encoding" header
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||