Skip to content
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

method close() does not call the correspondant close method on childs #287

Closed
nikcapl opened this issue Feb 24, 2021 · 2 comments
Closed
Labels
new-feature New feature or request resolved
Projects

Comments

@nikcapl
Copy link

nikcapl commented Feb 24, 2021

As per the Stream specification, the close() method should recursively call the child's correspondent method so that the user does not have to iterate all over the nested childs. As far as I can see, the ZipOutputStream.close() method does not call the ZipOutputStream.closeEntry(), thus leaving the stream in an inconsistent value.
To prove this behavior it's sufficient to close the stream without explicitly calling the closeEntry() method: in this case the JVM will throw an exception (java.io.IOException: java.util.zip.DataFormatException: invalid stored block lengths).

@srikanth-lingala
Copy link
Owner

This is a good idea. I will analyse this, and if feasible, I will include it in the next release.

@srikanth-lingala srikanth-lingala added the new-feature New feature or request label Apr 6, 2021
@srikanth-lingala srikanth-lingala added this to To do in Zip4j via automation Apr 6, 2021
@srikanth-lingala srikanth-lingala moved this from To do to Review in Zip4j May 25, 2021
@srikanth-lingala
Copy link
Owner

Fixed in v2.8.0 released today.

Zip4j automation moved this from Review to Done May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature New feature or request resolved
Projects
Zip4j
  
Done
Development

No branches or pull requests

2 participants