发布网友 发布时间:2022-04-22 11:11
共1个回答
热心网友 时间:2023-07-09 17:20
publicstaticvoidmakeZip(ListfileList,StringzipPath,booleanisDelete){byte[]buf=newbyte[1024];try{//CreatetheZIPfileFilezipFile=newFile(zipPath);ZipOutputStreamout=newZipOutputStream(newFileOutputStream(zipFile));//Compressthefilesfor(inti=0;i0){out.write(buf,0,len);}//Completetheentryout.closeEntry();in.close();}//CompletetheZIPfileout.close();System.out.println("压缩完成.");//把旧的文件删除if(isDelete==true){for(inti=0;i