br = new BufferedReader(new InputStreamReader(new GZIPInputStream(wikiXMLFile.openStream()), "UTF-8"));
} else if (wikiXMLFile.toExternalForm().endsWith(".bz2")) {
InputStream fis = wikiXMLFile.openStream();
byte[] ignoreBytes = new byte[2];
fis.read(ignoreBytes); //"B", "Z" bytes from commandline tools
br = new BufferedReader(new InputStreamReader(new CBZip2InputStream(fis), "UTF-8"));
} else {
br = new BufferedReader(new InputStreamReader(wikiXMLFile.openStream(), "UTF-8"));
}
return new InputSource(br);