Here you can find the source of writeBytesInFile(File f, String data)
public static void writeBytesInFile(File f, String data) throws FileNotFoundException, IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void writeBytesInFile(String f, String data) throws FileNotFoundException, IOException { writeBytesInFile(new File(f), data.getBytes()); }/*from w w w. j av a 2 s .com*/ public static void writeBytesInFile(File f, String data) throws FileNotFoundException, IOException { writeBytesInFile(f, data.getBytes()); } public static void writeBytesInFile(File f, byte[] data) throws FileNotFoundException, IOException { FileOutputStream fos = new FileOutputStream(f, false); fos.write(data); fos.close(); } }