protected InputStream getCompressorInputStream ( InputStream inputStream , CompressionType compressionType ) throws IOException { switch ( compressionType ) { case NONE : return inputStream ; case GZIP : return new GZIPInputStream ( inputStream ) ; case BZ2 : return new BZip2CompressorInputStream ( new BufferedInputStream ( inputStream ) ) ; default : throw new IllegalArgumentException ( "Unsupported compression type: " + compressionType ) ; } }
Returns an input stream that applies the required decompression to the given input stream .