I need to create a zip file and am limited by the following conditions:
- The entries come as byte[] (or ByteArrayOutputStream) and not as File.
- The filenames for the entry can be non-ascii/UTF-8.
- JDK 1.6 or earlier
Since java.util.zip only supports UTF-8 filenames from JDK 1.7 and onward, it seems better to use commons-compress ZipArchiveOutputStream. But how to create a ZipEntryArchive based on a byte array or ByteArrayOutputStream rather than a File?
Thank you!