Here you can find the source of decompress(byte[] compressedData)
public static byte[] decompress(byte[] compressedData) throws IOException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; public class Main { public static byte[] decompress(byte[] compressedData) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(compressedData.length); GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(compressedData)); byte[] buffer = new byte[compressedData.length]; while (true) { int bytesRead = in.read(buffer, 0, buffer.length); if (bytesRead < 0) { return bytes.toByteArray(); }//from w w w. ja v a 2 s .c o m bytes.write(buffer, 0, bytesRead); } } }