Here you can find the source of unzip(byte[] data)
public static byte[] unzip(byte[] data) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.GZIPInputStream; public class Main { public static byte[] unzip(byte[] data) throws IOException { InputStream in = new ByteArrayInputStream(data); ByteArrayOutputStream out = new ByteArrayOutputStream(); try {/*w w w .j a v a2 s . c om*/ in = new GZIPInputStream(in); byte[] buffer = new byte[65536]; int noRead; while ((noRead = in.read(buffer)) != -1) { out.write(buffer, 0, noRead); } } finally { try { out.close(); } catch (Exception e) { } } return out.toByteArray(); } }