I have the following code that writes a text file in a zip:
FileOutputStream fOut = new FileOutputStream(fullFilename, false);
BufferedOutputStream bOut = new BufferedOutputStream(fOut);
ZipOutputStream zOut = new ZipOutputStream(bOut);
zOut.putNextEntry(new ZipEntry("aFile1.txt"));
//Do some processing and write to zOut...
zOut.write(...);
(...)
zOut.closeEntry();
zOut.close();
//Etc (close all resources)
I would need to change the filename of the zipEntry after it has been written (as its name will depend on its content written).
Also, it is not an option to write in a buffer and write to file only when final filename is known (because file size is potentially very large: not enough memory).
Any advice on how to do this would be greatly appreciated!
Thanks, Thomas