Here you can find the source of decompress(InputStream inputStream)
public static InputStream decompress(InputStream inputStream) throws IOException
//package com.java2s; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.GZIPInputStream; public class Main { public static InputStream decompress(InputStream inputStream) throws IOException { inputStream = new BufferedInputStream(inputStream); inputStream.mark(1024);//from w w w .ja va 2s. com try { inputStream = new GZIPInputStream(inputStream); } catch (IOException e) { inputStream.reset(); } return inputStream; } }