ZipOutputStream zos = new ZipOutputStream(out);
for (File file : fileList) {
TestUtil.yasuo(file, zos);
}
zos.close();//这里必须关闭,否则winrar解压会报错
java导出Zip包使用WinRAR解压时报不可预料的压缩文件末端
![](https://img-home.csdnimg.cn/images/20240711042549.png)
ZipOutputStream zos = new ZipOutputStream(out);
for (File file : fileList) {
TestUtil.yasuo(file, zos);
}
zos.close();//这里必须关闭,否则winrar解压会报错