Here you can find the source of unzip(byte[] zipBytes)
public static byte[] unzip(byte[] zipBytes) throws IOException
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.ZipInputStream; public class Main { public static byte[] unzip(byte[] zipBytes) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(zipBytes); ZipInputStream zis = new ZipInputStream(bais); zis.getNextEntry();/*from w w w . j a v a 2 s .com*/ ByteArrayOutputStream baos = new ByteArrayOutputStream(); final int BUFSIZ = 4096; byte inbuf[] = new byte[BUFSIZ]; int n; try { while ((n = zis.read(inbuf, 0, BUFSIZ)) != -1) { baos.write(inbuf, 0, n); } } catch (Exception ex) { ex.printStackTrace(); } byte[] data = baos.toByteArray(); zis.close(); return data; } }