ZipException:invalid entry compressed size (expected 24709 but got 24714 bytes)
Posted 请叫我大师兄_
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ZipException:invalid entry compressed size (expected 24709 but got 24714 bytes)相关的知识,希望对你有一定的参考价值。
在使用ZipEntry操作jar包的时候,出了异常
java.util.zip.ZipException:invalid entry compressed size (expected 19845 but got 19850 bytes)
at java.util.zip.ZipOutputStream.closeEntry(267)
at java.util.zip.ZipOutputStream.finish(360)
at java.util.zip.DeflaterOutputStream.close(238)
at java.util.zip.ZipOutputStream.close(377)
问题在于:
原来报错的方式是这么写的:desJar.putNextEntry(entry);
改成:desJar.putNextEntry(new ZipEntry(entry.getName()));
不要直接使用原来的对象,自己new个新的接着。
以上是关于ZipException:invalid entry compressed size (expected 24709 but got 24714 bytes)的主要内容,如果未能解决你的问题,请参考以下文章
ZipException:invalid entry compressed size (expected 24709 but got 24714 bytes)
ZipException:invalid entry compressed size (expected 24709 but got 24714 bytes)
部署 Maven 项目抛出 java.util.zip.ZipException: invalid LOC header (bad signature)
java.util.zip.ZipException: invalid LOC header (bad signature)
启动TOMCAT报错 java.util.zip.ZipException: invalid LOC header (bad signature)
Java的ZipFile报错:Caused by: java.util.zip.ZipException: invalid CEN header (bad entry name)