Here you can find the source of writeFile(File file, byte[] data)
public static void writeFile(File file, byte[] data) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void writeFile(File file, byte[] data) throws IOException { FileOutputStream os = new FileOutputStream(file); try {//from w w w. j a v a 2s. c o m os.write(data); } finally { os.close(); } } public static void writeFile(File file, String text, String enc) throws IOException { writeFile(file, text.getBytes(enc)); } public static void writeFile(File file, String text) throws IOException { writeFile(file, text, "utf-8"); } }