寻找 Apache Commons Compress ( https://commons.apache.org/proper/commons-compress/ ) 的替代压缩 java 库。尝试读取使用 deflate64 的“ENHANCED_DEFLATED”压缩的 zip 条目时,Commons Compress 会引发错误。这是引发异常的示例摘录。
public void doRecurseZip(File inputFile)
throws IOException{
ZipFile srcZip = null;
srcZip = new ZipFile(inputFile);
final Enumeration<ZipArchiveEntry> entries = srcZip.getEntries();
while (entries.hasMoreElements()) {
final ZipArchiveEntry srcEntry = entries.nextElement();
String entryFilename = srcEntry.getName();
String entryMimetype = "application/octet-stream";
boolean canRead = srcZip.canReadEntryData(srcEntry);
InputStream zipStream = srcZip.getInputStream(srcEntry);
zipStream.close();
}
srcZip.close();
}
这是堆栈跟踪的相关部分:
在org.apache.commons.compress.archivers.zip.ZipFile.getInputStream(ZipFile.java:404) 在ZippingAround.doRecurseZip(ZippingAround.java:23)
有谁知道另一个可以替代 Commons Compress 的 zip 库,或者可能与它一起用于 deflate64 压缩方法?