I have generated many BufferedImages in memory and I want to compress them into one zip file before sending it as a email attachment. How do I save the files to a zip withou
FileInputStream[] ins = //I assume you have all file handles in the form of FileInputStream
String[] fileNames = //I assume you have all file names
FileOutputStream out = new FileOutputStream(""); //specify the zip file name here
ZipOutputStream zipOut = new ZipOutputStream(out);
for (int i=0; i
Based on the information you have provided, I come up with the code above. Hope this helps.