ZipOutputStream zos = new ZipOutputStream(out);
for (File file : fileList) {
TestUtil.yasuo(file, zos);
}
zos.close();//这里必须关闭,否则winrar解压会报错
java导出Zip包使用WinRAR解压时报不可预料的压缩文件末端
本文介绍了如何在Java中使用ZipOutputStream对文件进行压缩,通过遍历fileList,调用TestUtil.yasuo方法,最后强调了必须关闭ZipOutputStream以避免WinRAR解压时出现错误。

被折叠的 条评论
为什么被折叠?



