Package org.aoju.bus.core.compress
Class ZipReader
java.lang.Object
org.aoju.bus.core.compress.ZipReader
- All Implemented Interfaces:
Closeable,AutoCloseable
Zip文件或流读取器,一般用于Zip文件解压
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescription构造ZipReader(InputStream in, Charset charset) 构造构造ZipReader(ZipInputStream zin) 构造 -
Method Summary
-
Constructor Details
-
ZipReader
-
ZipReader
-
ZipReader
-
ZipReader
-
-
Method Details
-
of
-
of
创建ZipReader- Parameters:
in- Zip输入的流,一般为输入文件流charset- 编码- Returns:
- this
-
get
获取指定路径的文件流 如果是文件模式,则直接获取Entry对应的流,如果是流模式,则遍历entry后,找到对应流返回- Parameters:
path- 路径- Returns:
- 文件流
-
readTo
解压到指定目录中- Parameters:
outFile- 解压到的目录- Returns:
- 解压的目录
- Throws:
InternalException- IO异常
-
readTo
解压到指定目录中- Parameters:
outFile- 解压到的目录entryFilter- 过滤器,排除不需要的文件- Returns:
- 解压的目录
- Throws:
InternalException- IO异常
-
read
读取并处理Zip文件中的每一个ZipEntry- Parameters:
consumer-ZipEntry处理器- Returns:
- this
- Throws:
InternalException- IO异常
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
InternalException
-