Here you can find the source of gunzip(byte[] data)
public static byte[] gunzip(byte[] data) throws IOException
//package com.java2s; //License from project: Apache License import com.google.common.io.ByteStreams; 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[] gunzip(byte[] data) throws IOException { InputStream in = new GZIPInputStream(new ByteArrayInputStream(data)); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteStreams.copy(in, out);/* w ww .j av a2s. c o m*/ return out.toByteArray(); } }