code: public static GZIPInputStream gzipInputStream(final InputStream in) throws IOException
    {
      return new GZIPInputStream(
          new FilterInputStream(in)
          {
            @Override
            public int available() throws IOException
            {
              final int otherAvailable = super.available();
              // Hack. Docs say available() should return an estimate,
              // so we estimate about 1KB to work around available == 0 bug in GZIPInputStream
              return otherAvailable == 0 ? 1 << 10 : otherAvailable;
            }
          }
      );
    }
docs: Fixes java bug 7036144 http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7036144 which affects concatenated GZip
  
  @param in The raw input stream
  
  @return A GZIPInputStream that can handle concatenated gzip streams in the input
  
  @see #decompress(InputStream, String) which should be used instead for streams coming from files