It looks like according to the JDK epic link , you can use the while zis.getNextEntry() != null loop to cycle through the file (where zis is ZipInputStream), then use zis.read() to read into the array that is sent to ArrayList or similar.
Then one could use toArray() , "pass" it to the byte array using this method, and zos.write() into it the output ZIP file (where zos is ZipOutputStream ), using zos.putNextEntry() to create new records. (You will need to save ZipEntry and get its name with ze.getName() , and ze will be ZipEntry .) You should replace T with byte and byte (use byte everywhere, but for body of the loop) and you may need to change the cast code, to use Byte.byteValue() to convert from byte (wrapper class) to byte (primitive type), for example:
for(int i = 0; i < objects.length; i++) { convertedObjects[i] = (Byte)objects[i].byteValue(); }
Note that this is unchecked and based on the JDK ( ZipInputStream , ZipOutputStream , ArrayList and byte entries) and Google search on array casting.
Sorry if this was a little tight and hope this helps!
source share