- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中io.netty.handler.codec.compression.ZlibCodecFactory
类的一些代码示例,展示了ZlibCodecFactory
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZlibCodecFactory
类的具体详情如下:
包路径:io.netty.handler.codec.compression.ZlibCodecFactory
类名称:ZlibCodecFactory
[英]Creates a new ZlibEncoder and a new ZlibDecoder.
[中]创建一个新的ZlibEncoder和一个新的ZlibDecoder。
代码示例来源:origin: wildfly/wildfly
@Override
protected EmbeddedChannel newContentDecoder(String contentEncoding) throws Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) ||
X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP));
}
if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) ||
X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
final ZlibWrapper wrapper = strict ? ZlibWrapper.ZLIB : ZlibWrapper.ZLIB_OR_NONE;
// To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper));
}
// 'identity' or unsupported
return null;
}
}
代码示例来源:origin: wildfly/wildfly
/**
* Generate a new instance of an {@link EmbeddedChannel} capable of compressing data
* @param ctx the context.
* @param wrapper Defines what type of encoder should be used
*/
private EmbeddedChannel newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibEncoder(wrapper, compressionLevel, windowBits,
memLevel));
}
代码示例来源:origin: wildfly/wildfly
/**
* Constructor with default configuration.
*/
public PerMessageDeflateServerExtensionHandshaker() {
this(6, ZlibCodecFactory.isSupportingWindowSizeAndMemLevel(), MAX_WINDOW_SIZE, false, false);
}
代码示例来源:origin: com.wavefront/proxy
logger.info("Inbound data from " + ctx.channel().remoteAddress()+ " has less that 2 readable bytes - ignoring ");
return;
final ChannelPipeline pipeline = ctx.pipeline();
.addLast("gzipdeflater", ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP))
.addLast("gzipinflater", ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP))
.addLast("unificationB", new PlainTextOrHttpFrameDecoder(handler, maxLengthPlaintext, maxLengthHttp, false));
} else if (isHttp(firstByte, secondByte)) {
代码示例来源:origin: wildfly/wildfly
throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));
decoder.writeInbound(msg.content().retain());
if (appendFrameTail(msg)) {
decoder.writeInbound(Unpooled.wrappedBuffer(FRAME_TAIL));
CompositeByteBuf compositeUncompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partUncompressedContent = decoder.readInbound();
代码示例来源:origin: wildfly/wildfly
List<Object> out) throws Exception {
if (encoder == null) {
encoder = new EmbeddedChannel(ZlibCodecFactory.newZlibEncoder(
ZlibWrapper.NONE, compressionLevel, windowSize, 8));
encoder.writeOutbound(msg.content().retain());
CompositeByteBuf fullCompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partCompressedContent = encoder.readOutbound();
if (partCompressedContent == null) {
break;
代码示例来源:origin: io.higgs/core
private void enableGzip(ChannelHandlerContext ctx) {
ChannelPipeline p = ctx.pipeline();
p.addLast("gzipdeflater", ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP));
p.addLast("gzipinflater", ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP));
p.addLast("unificationB", new Transducer(detectSsl, false, factories, methods));
p.remove(this);
}
代码示例来源:origin: com.ebay.jetstream/jetstreamcore
String contenteEncoding;
if ("gzip".equals(m_config.getCompressEncoder())) {
encoder = new EmbeddedChannel(ZlibCodecFactory.newZlibEncoder(
ZlibWrapper.GZIP, 1));
contenteEncoding = "gzip";
encoder = new EmbeddedChannel(ZlibCodecFactory.newZlibEncoder(
ZlibWrapper.ZLIB, 1));
contenteEncoding = "deflate";
encoder.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
encoder.writeOutbound(byteBuf);
encoder.finish();
代码示例来源:origin: line/armeria
ZlibStreamDecoder(ZlibWrapper zlibWrapper) {
decoder = new EmbeddedChannel(false, ZlibCodecFactory.newZlibDecoder(zlibWrapper));
}
代码示例来源:origin: wavefrontHQ/java
logger.info("Inbound data from " + ctx.channel().remoteAddress()+ " has less that 2 readable bytes - ignoring ");
return;
final ChannelPipeline pipeline = ctx.pipeline();
.addLast("gzipdeflater", ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP))
.addLast("gzipinflater", ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP))
.addLast("unificationB", new PlainTextOrHttpFrameDecoder(handler, maxLengthPlaintext, maxLengthHttp, false));
} else if (isHttp(firstByte, secondByte)) {
代码示例来源:origin: io.netty/netty-codec-http
throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));
decoder.writeInbound(msg.content().retain());
if (appendFrameTail(msg)) {
decoder.writeInbound(Unpooled.wrappedBuffer(FRAME_TAIL));
CompositeByteBuf compositeUncompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partUncompressedContent = decoder.readInbound();
代码示例来源:origin: io.netty/netty-codec-http
List<Object> out) throws Exception {
if (encoder == null) {
encoder = new EmbeddedChannel(ZlibCodecFactory.newZlibEncoder(
ZlibWrapper.NONE, compressionLevel, windowSize, 8));
encoder.writeOutbound(msg.content().retain());
CompositeByteBuf fullCompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partCompressedContent = encoder.readOutbound();
if (partCompressedContent == null) {
break;
代码示例来源:origin: zcourts/higgs
private void enableGzip(ChannelHandlerContext ctx) {
ChannelPipeline p = ctx.pipeline();
p.addLast("gzipdeflater", ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP));
p.addLast("gzipinflater", ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP));
p.addLast("unificationB", new Transducer(detectSsl, false, factories, methods));
p.remove(this);
}
代码示例来源:origin: wildfly/wildfly
new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibEncoder(
wrapper, compressionLevel, windowBits, memLevel)));
代码示例来源:origin: wildfly/wildfly
/**
* Returns a new {@link EmbeddedChannel} that decodes the HTTP2 message content encoded in the specified
* {@code contentEncoding}.
*
* @param contentEncoding the value of the {@code content-encoding} header
* @return a new {@link ByteToMessageDecoder} if the specified encoding is supported. {@code null} otherwise
* (alternatively, you can throw a {@link Http2Exception} to block unknown encoding).
* @throws Http2Exception If the specified encoding is not not supported and warrants an exception
*/
protected EmbeddedChannel newContentDecompressor(final ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP));
}
if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) || X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
final ZlibWrapper wrapper = strict ? ZlibWrapper.ZLIB : ZlibWrapper.ZLIB_OR_NONE;
// To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper));
}
// 'identity' or unsupported
return null;
}
代码示例来源:origin: apache/activemq-artemis
throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));
decoder.writeInbound(msg.content().retain());
if (appendFrameTail(msg)) {
decoder.writeInbound(Unpooled.wrappedBuffer(FRAME_TAIL));
CompositeByteBuf compositeUncompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partUncompressedContent = decoder.readInbound();
代码示例来源:origin: apache/activemq-artemis
List<Object> out) throws Exception {
if (encoder == null) {
encoder = new EmbeddedChannel(ZlibCodecFactory.newZlibEncoder(
ZlibWrapper.NONE, compressionLevel, windowSize, 8));
encoder.writeOutbound(msg.content().retain());
CompositeByteBuf fullCompressedContent = ctx.alloc().compositeBuffer();
for (;;) {
ByteBuf partCompressedContent = encoder.readOutbound();
if (partCompressedContent == null) {
break;
代码示例来源:origin: wildfly/wildfly
/**
* Constructor with default configuration.
*/
public PerMessageDeflateClientExtensionHandshaker() {
this(6, ZlibCodecFactory.isSupportingWindowSizeAndMemLevel(), MAX_WINDOW_SIZE, false, false);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Generate a new instance of an {@link EmbeddedChannel} capable of compressing data
* @param ctx the context.
* @param wrapper Defines what type of encoder should be used
*/
private EmbeddedChannel newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibEncoder(wrapper, compressionLevel, windowBits,
memLevel));
}
代码示例来源:origin: io.netty/netty-codec-http
@Override
protected EmbeddedChannel newContentDecoder(String contentEncoding) throws Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) ||
X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP));
}
if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) ||
X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
final ZlibWrapper wrapper = strict ? ZlibWrapper.ZLIB : ZlibWrapper.ZLIB_OR_NONE;
// To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper));
}
// 'identity' or unsupported
return null;
}
}
我正在尝试使用 user guide 中的抓取示例运行 geb用于引入依赖项: $ cat my.groovy @Grapes([ @Grab("org.gebish:geb-core:0.9
我阅读了很多关于 opus-codec 的内容,但我不明白如何在我的示例 Java 应用程序中使用它。 是否有任何可用于 opus 的 .so 文件可以使用?如果没有,那么如何? 最佳答案 目前(在撰
我试图构建 Maven 项目, 每当我在命令行上运行“mvn clean install”时,都会出现以下错误: 无法解析项目 com.my_project:jar:0.0.1-SNAPSHOT 的依
我有一个项目需要 Lucene(4.3.0) 并添加以下依赖项:lucene-core,lucene-analyzers-common,lucene-queries,lucene-queryparse
我正在对 Controller 进行单元测试,目前我被服务(由 Controller 调用)中的“encodeAsJSON()”方法调用所困扰。 我得到了 MissingMethodException
无法弄清楚是什么原因导致 ' 名称为“Lucene42”的 org.apache.lucene.codecs.Codec 类型的 SPI 类不存在。您需要将支持此 SPI 的相应 JAR 文件添加到您
我想运行以下命令来使用 MongoDB Java 驱动程序创建用户, client = new MongoClient(mongoClientURI); MongoDatabase d
对于 lucene-core-5.5.2,我在 weblogic 服务器中遇到了问题 a。独立的搜索应用程序可以工作,但是当我部署为 WEB APP 时,它失败并出现以下错误 Exception ty
我的代码: DateTime dateTime = new DateTime(); BasicDBObject oldDoc = new BasicDBObject("email",email); B
我正在尝试在 Hibernate-ogm 中尝试 GridFS。这就是我的课 import org.hibernate.ogm.datastore.mongodb.type.GridFS; @Embe
我正在使用如下聚合: final List aggregations = new ArrayList<>(); Polygon polygon = new Polygon(new Po
我正在处理一个多模块 gradle 项目(12 个模块)。我继承了该项目,需要更新其中使用的一些库的版本。 我无法理解此错误的原因: ... 67 more Caused by: java.l
我正在使用 Java 学习 MongoDB。我正在尝试使用 Java 驱动程序将数据插入 MongoDB。我正在像 MongoDB 教程中一样进行插入,而且一切都很好。但是如果我想插入一个变量,当我运
我正在尝试打开并读取包含大量文本的 .txt 文件。下面是我的代码,我不知道如何解决这个问题。任何帮助将不胜感激。 file = input("Please enter a .txt file: ")
我使用 Arch Linux 和默认的 Python 3。我使用 Konsole 通过命令 pip install django-toolbelt 下载 django-toolbelt。名称: pip
我正在尝试使用 LibAV 解码 mpeg 视频文件。有两个术语我无法正确理解,镜框 和 数据包 . 按照我目前的理解,镜框 是未压缩的视频帧和 数据包是压缩帧。 问题 : 数据包有多个帧,对吗? 一
我正在查看计算机断层扫描 (CT) DICOM 图像。这些最初是未压缩的 DICOM 图像。我有这些 DICOM 图像的无损 J2K 压缩形式:传输语法 = 1.2.840.10008.1.2.4.9
如何安装通用编解码器?我已经下载了,但是我在网上搜索过,找不到这个问题的答案。我想使用 Base64 编码器和解码器。 还有 1 个问题,如果我的代码使用这个编解码器,其他尝试使用我的程序的用户是否也
本文整理了Java中loci.formats.codec.ZlibCodec类的一些代码示例,展示了ZlibCodec类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Ma
本文整理了Java中hivemall.utils.codec.ZigZagLEB128Codec类的一些代码示例,展示了ZigZagLEB128Codec类的具体用法。这些代码示例主要来源于Githu
我是一名优秀的程序员,十分优秀!