Here you can find the source of writeBytes(File outputFile, byte[] bytes)
public static void writeBytes(File outputFile, byte[] bytes) 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 writeBytes(File outputFile, byte[] bytes) throws IOException { outputFile.getParentFile().mkdirs(); FileOutputStream outputStream = new FileOutputStream(outputFile); try {/*from ww w.ja v a2 s . co m*/ outputStream.write(bytes); } finally { outputStream.close(); } } }