|| "gzip".equals(contentEncoding)
|| "x-gzip".equals(contentEncoding)) {
return new GZIPInputStream(new FileInputStream(file));
} else if (fileName.endsWith(".bz2")) {
InputStream is = new FileInputStream(file);
is.mark(4);
if (!(is.read() == 'B' && is.read() == 'Z')) {
// No BZ prefix as appended by command line tools. Reset and hope for the best
is.reset();
}
return new CBZip2InputStream(is);