[英]Java 8 zipfile > 4 GB . ZipException: invalid CEN header (bad signature)
I'm having this error with java 1.8.0_60
on a zipfile
> 4 GB
我在大于
4 GB
的zipfile
上遇到Java 1.8.0_60
错误
I found that should be possible through zip64. 我发现应该可以通过zip64实现。
ZipFile zipFile = new ZipFile(zippedFile);
Error : 错误:
java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
Should I get the entries in another way to use zip64 ? 我应该以其他使用zip64的方式获取条目吗?
I would do like this: 我会这样:
FileInputStream fInput = new FileInputStream(zipFileName);
ZipInputStream zipInput = new ZipInputStream(fInput);
ZipEntry entry = zipInput.getNextEntry();
while(entry != null){
String entryName = entry.getName();
File file = new File(destinationFolder + File.separator + entryName);
// Do whatever you need with the file here
}
Cross topic for large files : Read large files in Java 大文件的交叉主题: 使用Java读取大文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.