public static void writeFile(String outputFileName, byte[] data, boolean debug) {
        if (debug) {
            EobLogger.println("Writing binary file with name: " + outputFileName + " ...");
        }
        try {
            OutputStream output = null;
            try {
                output = new BufferedOutputStream(new FileOutputStream(outputFileName));
                output.write(data, 0, data.length);
            } finally {
                if (output != null) {
                    output.close();
                }
            }
        } catch (FileNotFoundException ex) {
            EobLogger.println("File not found.");
        } catch (IOException ex) {
            EobLogger.println(ex.getMessage());
            ex.printStackTrace();
        }
    }