本文整理了Java中io.netty.handler.codec.compression.ZlibUtil
类的一些代码示例,展示了ZlibUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZlibUtil
类的具体详情如下:
包路径:io.netty.handler.codec.compression.ZlibUtil
类名称:ZlibUtil
[英]Utility methods used by JZlibEncoder and JZlibDecoder.
[中]JZlibEncoder和JZlibDecoder使用的实用方法。
代码示例来源:origin: netty/netty
ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(wrapper);
代码示例来源:origin: netty/netty
static void fail(Deflater z, String message, int resultCode) {
throw deflaterException(z, message, resultCode);
}
代码示例来源:origin: netty/netty
static void fail(Inflater z, String message, int resultCode) {
throw inflaterException(z, message, resultCode);
}
代码示例来源:origin: netty/netty
/**
* Creates a new instance with the specified wrapper.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper) {
if (wrapper == null) {
throw new NullPointerException("wrapper");
}
int resultCode = z.init(ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: netty/netty
ZlibUtil.fail(z, "initialization failure", resultCode);
} else {
resultCode = z.deflateSetDictionary(dictionary, dictionary.length);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "failed to set the dictionary", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(ZlibWrapper.ZLIB);
代码示例来源:origin: netty/netty
/**
* Creates a new instance with the specified preset dictionary. The wrapper
* is always {@link ZlibWrapper#ZLIB} because it is the only format that
* supports the preset dictionary.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(byte[] dictionary) {
if (dictionary == null) {
throw new NullPointerException("dictionary");
}
this.dictionary = dictionary;
int resultCode;
resultCode = z.inflateInit(JZlib.W_ZLIB);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: redisson/redisson
/**
* Creates a new instance with the specified wrapper.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper) {
if (wrapper == null) {
throw new NullPointerException("wrapper");
}
int resultCode = z.init(ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: redisson/redisson
ZlibUtil.fail(z, "initialization failure", resultCode);
} else {
resultCode = z.deflateSetDictionary(dictionary, dictionary.length);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "failed to set the dictionary", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(ZlibWrapper.ZLIB);
代码示例来源:origin: redisson/redisson
/**
* Creates a new instance with the specified preset dictionary. The wrapper
* is always {@link ZlibWrapper#ZLIB} because it is the only format that
* supports the preset dictionary.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(byte[] dictionary) {
if (dictionary == null) {
throw new NullPointerException("dictionary");
}
this.dictionary = dictionary;
int resultCode;
resultCode = z.inflateInit(JZlib.W_ZLIB);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: redisson/redisson
ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(wrapper);
代码示例来源:origin: wildfly/wildfly
/**
* Creates a new instance with the specified wrapper.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper) {
if (wrapper == null) {
throw new NullPointerException("wrapper");
}
int resultCode = z.init(ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: wildfly/wildfly
ZlibUtil.fail(z, "initialization failure", resultCode);
} else {
resultCode = z.deflateSetDictionary(dictionary, dictionary.length);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "failed to set the dictionary", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(ZlibWrapper.ZLIB);
代码示例来源:origin: wildfly/wildfly
/**
* Creates a new instance with the specified preset dictionary. The wrapper
* is always {@link ZlibWrapper#ZLIB} because it is the only format that
* supports the preset dictionary.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(byte[] dictionary) {
if (dictionary == null) {
throw new NullPointerException("dictionary");
}
this.dictionary = dictionary;
int resultCode;
resultCode = z.inflateInit(JZlib.W_ZLIB);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: redisson/redisson
static void fail(Deflater z, String message, int resultCode) {
throw deflaterException(z, message, resultCode);
}
代码示例来源:origin: redisson/redisson
static void fail(Inflater z, String message, int resultCode) {
throw inflaterException(z, message, resultCode);
}
代码示例来源:origin: wildfly/wildfly
ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(wrapper);
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Creates a new instance with the specified wrapper.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper) {
if (wrapper == null) {
throw new NullPointerException("wrapper");
}
int resultCode = z.init(ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
代码示例来源:origin: io.netty/netty-codec
ZlibUtil.fail(z, "initialization failure", resultCode);
} else {
resultCode = z.deflateSetDictionary(dictionary, dictionary.length);
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "failed to set the dictionary", resultCode);
wrapperOverhead = ZlibUtil.wrapperOverhead(ZlibWrapper.ZLIB);
代码示例来源:origin: netty/netty
ZlibUtil.fail(z, "compression failure", resultCode);
代码示例来源:origin: wildfly/wildfly
static void fail(Deflater z, String message, int resultCode) {
throw deflaterException(z, message, resultCode);
}
内容来源于网络,如有侵权,请联系作者删除!