Here you can find the source of uncompress(byte[] b)
public static String uncompress(byte[] b) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.zip.GZIPInputStream; public class Main { private static final int BUFFER_SIZE = 1024; public static String uncompress(byte[] b) throws IOException { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { try (GZIPInputStream gzip = new GZIPInputStream(new ByteArrayInputStream(b), BUFFER_SIZE)) { byte[] buffer = new byte[BUFFER_SIZE]; int n; while ((n = gzip.read(buffer)) >= 0) { out.write(buffer, 0, n); }// w w w. java 2 s . co m } return out.toString(); } } }