Package com.luna.common.file.compress
Class Deflate
java.lang.Object
com.luna.common.file.compress.Deflate
- All Implemented Interfaces:
Closeable
,AutoCloseable
Deflate算法
Deflate是同时使用了LZ77算法与哈夫曼编码(Huffman Coding)的一个无损数据压缩算法。
Deflate是同时使用了LZ77算法与哈夫曼编码(Huffman Coding)的一个无损数据压缩算法。
- Since:
- 5.7.8
- Author:
- looly
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
deflater
(int level) 将普通数据流压缩获取目标流inflater()
将压缩流解压到target中static Deflate
of
(InputStream source, OutputStream target, boolean nowrap) 创建Deflate
-
Constructor Details
-
Deflate
构造- Parameters:
source
- 源流target
- 目标流nowrap
-true
表示兼容Gzip压缩
-
-
Method Details
-
of
创建Deflate- Parameters:
source
- 源流target
- 目标流nowrap
-true
表示兼容Gzip压缩- Returns:
- this
-
getTarget
获取目标流- Returns:
- 目标流
-
deflater
将普通数据流压缩- Parameters:
level
- 压缩级别,0~9- Returns:
- this
-
inflater
将压缩流解压到target中- Returns:
- this
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-