Skip to content

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