FileOutputStream destination = new FileOutputStream("Test.zip");
ZipOutputStream zip = new ZipOutputStream(destination);
zip.setMethod(ZipOutputStream.DEFLATED);
ZipEntry entry = new ZipEntry("test.txt");
zip.putNextEntry(entry);
zip.write(<file content>);
zip.closeEntry();
// write more entries
zip.close();
No comments:
Post a Comment