ZipInputStream 与我的 zip 文件不兼容 - 无效的 CEN 标头(错误的压缩方法) [英] ZipInputStream not compatible with my zip file - invalid CEN header (bad compression method)

查看:49
本文介绍了ZipInputStream 与我的 zip 文件不兼容 - 无效的 CEN 标头(错误的压缩方法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 java1.8.0_92"(我的操作系统支持的最新版本)在 java 中读取 zip 文件.

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:

无效的 CEN 头(错误的压缩方法)

当我使用 *nix(实际上是 OS X)file 命令分析文件时,我得到了详细信息:

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

压缩存档数据,至少要解压 v2.1

是否有我可以使用的第三方解压缩库能够读取此版本的 zip 文件?

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

推荐答案

根据 Zip维基百科页面,ZIP 格式规范的 2.1 版添加了对 Deflate64 压缩的支持:

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

2.1: (1996) Deflate64 压缩

2.1: (1996) Deflate64 compression

Apache Commons Compress 有未解决的功能请求.目前,据我所知,唯一支持此功能的库是 net.sf.sevenzipjbinding,但它只是 7-Zip 的包装.Apache Commons Compress 的功能请求现已解决,您可以使用它.

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.

相关问题:支持Deflate64的Java压缩库

这篇关于ZipInputStream 与我的 zip 文件不兼容 - 无效的 CEN 标头(错误的压缩方法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆