Here you can find the source of gunzip(byte[] in)
public static String gunzip(byte[] in) throws IOException
//package com.java2s; //License from project: LGPL import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.zip.GZIPInputStream; public class Main { public static String gunzip(byte[] in) throws IOException { GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(in)); BufferedReader bf = new BufferedReader(new InputStreamReader(gis, "UTF-8")); String outStr = ""; String line;//ww w. j a va2s . c o m while ((line = bf.readLine()) != null) outStr += line; return outStr; } }