//将文件列表压缩成压缩包
public void zipFiles(List files, String zipFilePath) throws IOException {
Log.e("测试====", "开始压缩文件===========" + zipFilePath);
byte[] buffer = new byte[1024];
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFilePath));
for (File file : files) {
FileInputStream fis = new FileInputStream(file);
out.putNextEntry(new ZipEntry(file.getName()));
int len;
while ((len = fis.read(buffer)) > 0) {
out.write(buffer, 0, len);
}
out.closeEntry();
fis.close();
}
out.close();
Log.e("测试====", "压缩文件完成=====22===========" + zipFilePath);
}