简体   繁体   中英

ZipInputStream not compatible with my zip file - invalid CEN header (bad compression method)

I am trying to read a zip file, in java, using java "1.8.0_92" (the latest supported version for my OS.

Unfortunately, I am getting an exception:

invalid CEN header (bad compression method)

When I use the *nix (actually OS X) file command to analyse the file I get the detail:

Zip archive data, at least v2.1 to extract

Is there a third-party unzip library I can use that is capable of reading this version of zip file?

According Zip page on wikipedia , version 2.1 of ZIP format specification added support to Deflate64 compression:

2.1: (1996) Deflate64 compression

There is unresolved feature request for Apache Commons Compress. At this time, as I know, the only library supporting this is net.sf.sevenzipjbinding , but it is only wrapper to 7-Zip. Feature request for Apache Commons Compress is resolved now, you can use it.

Related question: Java Compression Library To Support Deflate64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM