question: public static InputStream wrapAndCheckCompressionFormat ( InputStream in ) throws IOException { BufferedInputStream bufferedIn = new BufferedInputStream ( in ) ; if ( isZip ( bufferedIn ) ) { ZipInputStream zipIn = new ZipInputStream ( bufferedIn ) ; zipIn . getNextEntry ( ) ; return zipIn ; } else if ( isGZip ( bufferedIn ) ) { GZIPInputStream gzipIn = new GZIPInputStream ( bufferedIn ) ; return gzipIn ; } return bufferedIn ; }
target:  Test for ZIP/GZIP stream signature. Wraps the input stream in a BufferedInputStream. If ZIP/GZIP test is true wraps again in ZipInputStream/GZIPInputStream.