Here you can find the source of decompress(InputStream is, OutputStream os)
public static void decompress(InputStream is, OutputStream os) throws Exception
//package com.java2s; import java.io.InputStream; import java.io.OutputStream; import java.util.zip.GZIPInputStream; public class Main { static final int BUFFERSIZE = 1024; public static void decompress(InputStream is, OutputStream os) throws Exception { GZIPInputStream gin = new GZIPInputStream(is); int count; byte data[] = new byte[BUFFERSIZE]; while ((count = gin.read(data, 0, BUFFERSIZE)) != -1) { os.write(data, 0, count);/*ww w.j a v a2 s . c o m*/ } gin.close(); } }