Here you can find the source of writeBytes(File file, byte[] bytes, boolean append)
public static void writeBytes(File file, byte[] bytes, boolean append) throws Exception
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void writeBytes(File file, byte[] bytes, boolean append) throws Exception { try {//w ww . j av a 2s . c om FileOutputStream stream = new FileOutputStream(file, append); stream.write(bytes); stream.flush(); stream.close(); } catch (IOException t) { throw new Exception("could not write to " + file + ": " + new String(bytes), t); } } }