Here you can find the source of unZip(byte[] data)
public static byte[] unZip(byte[] data)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.zip.ZipInputStream; public class Main { public static byte[] unZip(byte[] data) { byte[] b = null; try {//from w w w .j av a 2s . c om ByteArrayInputStream bis = new ByteArrayInputStream(data); ZipInputStream zip = new ZipInputStream(bis); while (zip.getNextEntry() != null) { byte[] buf = new byte[1024]; int num = -1; ByteArrayOutputStream baos = new ByteArrayOutputStream(); while ((num = zip.read(buf, 0, buf.length)) != -1) { baos.write(buf, 0, num); } b = baos.toByteArray(); baos.flush(); baos.close(); } zip.close(); bis.close(); } catch (Exception ex) { ex.printStackTrace(); } return b; } }