New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for snappy http content encoding #13529
Conversation
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
Signed-off-by: xingrufei <qhdxssm@qq.com>
codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java
Outdated
Show resolved
Hide resolved
* {@link SnappyOptions} holds config for | ||
* Snappy compression. | ||
*/ | ||
public class SnappyOptions implements CompressionOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class SnappyOptions implements CompressionOptions { | |
public final class SnappyOptions implements CompressionOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Test | ||
public void snappyEncodingSingleEmptyMessage() throws Exception { | ||
final String text = ""; | ||
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes()); | |
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes(CharsetUtil.US_ASCII)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Test | ||
public void snappyEncodingSingleMessage() throws Exception { | ||
final String text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccc"; | ||
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes(CharsetUtil.UTF_8.name())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes(CharsetUtil.UTF_8.name())); | |
final ByteBuf data = Unpooled.copiedBuffer(text.getBytes(CharsetUtil.US_ASCII))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
058312e
to
b87b8f8
Compare
@skyguard1 thanks a lot |
It is my pleasure |
Motivation: Since netty already supports the decompression of snappy's http content encoding, it should also consider supporting snappy's http content compression Modification: Add support for snappy http content encoding Result: Netty supports snappy http content encoding --------- Signed-off-by: xingrufei <qhdxssm@qq.com>
Motivation:
Since netty already supports the decompression of snappy's http content encoding, it should also consider supporting snappy's http content compression
Modification:
Add support for snappy http content encoding
Result:
Netty supports snappy http content encoding