Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import java.io.FileOutputStream;

public class Main {
    public static void writeFile(File f, byte[] bS) throws Exception {

        if (f.isFile() && f.exists()) {
            f.delete();
        }

        FileOutputStream fos = new FileOutputStream(f);
        fos.write(bS, 0, bS.length);
        fos.flush();
        fos.close();
    }
}