Compress dynamic content to ServletOutputStream
I want to compress the dynamic created content and write to ServletOutputStream directly, without saving it as a file on the server before compressing. For example, I created an Excel Workbook and a StringBuffer that includes strings with the SQL template. I don't want to save the dynamic content to .xlsx and .sql file on the server before zipping the files and writing to ServletOutputStream for downloading. Sample Code: ServletOutputStream out = response.getOutputStream(); workbook.write(byteArrayOutputStream); zipIt(byteArrayOutputStream,out); public static boolean zipIt