if (inputFile.getName().endsWith("bz2")) {
FileInputStream fileInputStream = new FileInputStream(inputFile);
in = new BZip2CompressorInputStream(fileInputStream);
} else {
randomAccessFile = new RandomAccessFile(inputFile, "r");
in = new RandomAccessFileInputStream(randomAccessFile);
}
File outputFile = new File(outputFileName);
if (outputFile.exists()) {
throw new RuntimeException("Output file already exists " + outputFileName);