gpt4 book ai didi

io.netty.handler.codec.compression.ZlibCodecFactory.newZlibDecoder()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:00:49 29 4
gpt4 key购买 nike

本文整理了Java中io.netty.handler.codec.compression.ZlibCodecFactory.newZlibDecoder()方法的一些代码示例,展示了ZlibCodecFactory.newZlibDecoder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZlibCodecFactory.newZlibDecoder()方法的具体详情如下:
包路径:io.netty.handler.codec.compression.ZlibCodecFactory
类名称:ZlibCodecFactory
方法名:newZlibDecoder

ZlibCodecFactory.newZlibDecoder介绍

暂无

代码示例

代码示例来源:origin: line/armeria

ZlibStreamDecoder(ZlibWrapper zlibWrapper) {
  decoder = new EmbeddedChannel(false, ZlibCodecFactory.newZlibDecoder(zlibWrapper));
}

代码示例来源: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

/**
 * 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: wildfly/wildfly

throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));

代码示例来源: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: 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: com.wavefront/proxy

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: wavefrontHQ/java

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

@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: apache/activemq-artemis

@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: org.apache.activemq/artemis-jms-client-all

@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: org.jboss.eap/wildfly-client-all

@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: io.netty/netty-codec-http2

/**
 * 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: org.jboss.eap/wildfly-client-all

/**
 * 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));

代码示例来源:origin: io.netty/netty-codec-http

throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));

代码示例来源:origin: org.jboss.eap/wildfly-client-all

throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com