public class ZipStreamResource extends Object implements ZipResource
ZipInputStream 资源包装| Constructor and Description |
|---|
ZipStreamResource(ZipInputStream in)
构造
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
InputStream |
get(String path)
获取指定路径的文件流
如果是文件模式,则直接获取Entry对应的流,如果是流模式,则遍历entry后,找到对应流返回 |
InputStream |
get(ZipEntry entry)
获取指定
ZipEntry对应的文件流 |
void |
read(Consumer<ZipEntry> consumer,
int maxSizeDiff)
读取并处理Zip文件中的每一个
ZipEntry |
public ZipStreamResource(ZipInputStream in)
in - ZipInputStreampublic void read(Consumer<ZipEntry> consumer, int maxSizeDiff)
ZipResourceZipEntryread in interface ZipResourceconsumer - ZipEntry处理器maxSizeDiff - 检查ZipBomb文件差异倍数,-1表示不检查ZipBombpublic InputStream get(String path)
ZipResourceget in interface ZipResourcepath - 路径public InputStream get(ZipEntry entry)
ZipResourceZipEntry对应的文件流get in interface ZipResourceentry - ZipEntrypublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2025. All rights reserved.