java 如何将多个文件打包成一个zip

2024-11-16 22:25:52
推荐回答(1个)
回答(1):

java 将多个文件打包成一个zip的代码如下:
ZipOutputStream out=new ZipOutputStream(new FileOutputStream(zipFileName));
for(int i=0;i String filename = (String)fileList.get(i);
File file = new File(filename);
zip(out,file);
}
out.close();