io/src/main/java/com/stanfy/enroscar/io/IoUtils.java
public static InputStream getUncompressedInputStream(final String encoding, final InputStream source) throws IOException {
    if (ENCODING_GZIP.equalsIgnoreCase(encoding)) {
      return new GZIPInputStream(source);
    }
    if (ENCODING_DEFLATE.equalsIgnoreCase(encoding)) {
      final Inflater inflater = new Inflater(/*no header*/ true);
      return new InflaterInputStream(source, inflater);
    }
    return source;
  }
public static InputStream getUncompressedInputStream(final String encoding, final InputStream source) throws IOException {
    if (ENCODING_GZIP.equalsIgnoreCase(encoding)) {
      return new GZIPInputStream(source);
    }
    if (ENCODING_DEFLATE.equalsIgnoreCase(encoding)) {
      final Inflater inflater = new Inflater(/*no header*/ true);
      return new InflaterInputStream(source, inflater);
    }
    return source;
  }
public static InputStream getUncompressedInputStream ( final String encoding , final InputStream source ) throws IOException { if ( ENCODING_GZIP . equalsIgnoreCase ( encoding ) ) { return new GZIPInputStream ( source ) ; } if ( ENCODING_DEFLATE . equalsIgnoreCase ( encoding ) ) { final Inflater inflater = new Inflater ( /*no header*/ true ) ; return new InflaterInputStream ( source , inflater ) ; } return source ; }
Wraps the supplied stream into either {@link GZIPInputStream} or {@link InflaterInputStream}
depending on {@code encoding} parameter value.

@param encoding content encoding, supported values: {@link #ENCODING_GZIP}, {@link #ENCODING_DEFLATE}
@param source source stream
@return the uncompressed {@link InputStream}
@see #getUncompressedInputStream(java.net.URLConnection)
Wraps the supplied stream into either { @link GZIPInputStream } or { @link InflaterInputStream } depending on { @code encoding } parameter value .