Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.BufferedOutputStream;

import java.io.File;

import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void saveFile(File f, byte[] content) throws IOException {
        FileOutputStream fos = new FileOutputStream(f);
        try {
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            bos.write(content);
            bos.flush();
        } finally {
            fos.close();
        }
    }
}