You can use ZipInputStream and ZipOutputStream (in the java.util.zip package) to read and write from ZIP files.
If you have data in a byte array, you can let it read from ByteArrayInputStream or write to ByteArrayOutputStream pointing to your input and output byte arrays.
source share