-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception adding Streams at result file size > 4.2 GB #190
Comments
Code seems to be fine. It should have worked. I will try it out and update the thread. |
I was able to reproduce this. Working on a fix. |
Issue fixed. Will include the fix in the next release. |
Thank you for the fast response and fix. I tested this and can confirm the issue is solved in 2.6.1-SNAPSHOT. Good Work! |
There are a couple of more bugs reported that need to be fixed and I will make a release. Most likely this week/weekend. |
Fix included in v2.6.1 released today. |
Hi, I'm getting a exception if I add multiple streams to a zip file. The pseudo code and exception is below. Let the code run until the resulting zip file reaches 4.2 GB. I think that code should work, what do you think?
Thx in advance!
Code:
Path zipFile = /* zip File /;
byte[] bytes = Files.readAllBytes(/ path to 10 Mb file*/);
for (int i = 0; i < 500; i++) {
ZipParameters parameters = new ZipParameters();
parameters.setFileNameInZip(i + "");
new ZipFile(zipFile.toFile()).addStream(new ByteArrayInputStream(bytes), parameters);
}
Exception:
net.lingala.zip4j.exception.ZipException: invalid signature for zip64 end of central directory record
at net.lingala.zip4j.headers.HeaderReader.readZip64EndCentralDirRec(HeaderReader.java:389)
at net.lingala.zip4j.headers.HeaderReader.readAllHeaders(HeaderReader.java:91)
at net.lingala.zip4j.ZipFile.readZipInfo(ZipFile.java:973)
at net.lingala.zip4j.ZipFile.addStream(ZipFile.java:403)
I'm using version 2.6 but earlier versions were also affected in a different way. Version 2.3 doesnt throw an exception but produces a corrupted zip file.
The text was updated successfully, but these errors were encountered: