本文整理汇总了Java中com.jcraft.jzlib.ZStream类的典型用法代码示例。如果您正苦于以下问题:Java ZStream类的具体用法?Java ZStream怎么用?Java ZStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZStream类属于com.jcraft.jzlib包,在下文中一共展示了ZStream类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Zlib
import com.jcraft.jzlib.ZStream; //导入依赖的package包/类
/**
* Creates an instance of the ZLib class.
*
* @param compressionLevel the level of compression that should be used. One of
* <tt>COMPRESSION_MAX</tt>, <tt>COMPRESSION_MIN</tt>,
* <tt>COMPRESSION_NONE</tt> or <tt>COMPRESSION_DEFAULT</tt>
* @param mode the mode in which the instance will operate. Can be either
* of <tt>MODE_DEFLATER</tt> or <tt>MODE_INFLATER</tt>
* @throws IllegalArgumentException if the mode is incorrect
*/
public Zlib(int compressionLevel, int mode) {
switch (compressionLevel) {
case COMPRESSION_MAX:
case COMPRESSION_MIN:
case COMPRESSION_NONE:
case COMPRESSION_DEFAULT:
this.compressionLevel = compressionLevel;
break;
default:
throw new IllegalArgumentException("invalid compression level specified");
}
// create a new instance of ZStream. This will be done only once.
zStream = new ZStream();
switch (mode) {
case MODE_DEFLATER:
zStream.deflateInit(this.compressionLevel);
break;
case MODE_INFLATER:
zStream.inflateInit();
break;
default:
throw new IllegalArgumentException("invalid mode specified");
}
this.mode = mode;
}
开发者ID:eclipse,项目名称:neoscada,代码行数:38,代码来源:Zlib.java
示例2: Zlib
import com.jcraft.jzlib.ZStream; //导入依赖的package包/类
public Zlib() {
deflate = new ZStream();
inflate = new ZStream();
deflate.deflateInit(LEVEL);
inflate.inflateInit();
deflate_tmpbuf = new byte[DEFAULT_BUF_SIZE];
inflate_tmpbuf = new byte[DEFAULT_BUF_SIZE];
inflated_buf = new byte[DEFAULT_BUF_SIZE];
}
开发者ID:dragonlinux,项目名称:connectbot,代码行数:12,代码来源:Zlib.java
示例3: ZlibCompressor
import com.jcraft.jzlib.ZStream; //导入依赖的package包/类
public ZlibCompressor() {
mInflateStream = new ZStream();
mInflateStream.inflateInit();
mDeflateStream = new ZStream();
mDeflateStream.deflateInit(9);
mBuffer = new byte[BUFFER_SIZE];
}
开发者ID:freznicek,项目名称:jaramiko,代码行数:8,代码来源:ZlibCompressor.java
示例4: ZLibCompression
import com.jcraft.jzlib.ZStream; //导入依赖的package包/类
public ZLibCompression() {
stream = new ZStream();
}
开发者ID:sshtools,项目名称:j2ssh-maverick,代码行数:4,代码来源:ZLibCompression.java
注:本文中的com.jcraft.jzlib.ZStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论