问题解决:Java解压文件时报错:MALFORMED
解压zip文件的时候报错,原因是压缩文件中有中文;导致错误,解决办法是设置编码:
ZipFile zipOutFile = new ZipFile(zipFile,Charset.forName("gbk"));
错误:
java.lang.IllegalArgumentException: MALFORMED
at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:300)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122)
at test.Hello.UnZipFolder(Hello.java:36)
at test.Hello.main(Hello.java:10)
引用:https://blog.csdn.net/u012995897/article/details/80197815