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

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
Copy link
Owner

Fixed in v2.8.0 released today.

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
None yet
Development

No branches or pull requests

2 participants