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

blank files should be stored #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liuyuekeng
Copy link

If the empty file is not stored, using ZipInputStream to decompress will throw the following error:

    java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
    at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:310)
    at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122)
    at Alan.streamToUnzipFile(Alan.java:59)
    at Alan.main(Alan.java:29)

@ctalkington
Copy link
Member

https://github.com/archiverjs/node-compress-commons/blob/master/lib/archivers/zip/zip-archive-output-stream.js#L63 should already handle empty Buffers and strings. We dont know a streams length though until its fully consumed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants