Here you can find the source of writeFile(String fileName, String content)
public static void writeFile(String fileName, String content)
//package com.java2s; import java.io.FileOutputStream; public class Main { public static void writeFile(String fileName, byte[] content) { try {/*from w ww . j av a 2 s. c o m*/ FileOutputStream fos = new FileOutputStream(fileName); fos.write(content); fos.flush(); fos.close(); } catch (Exception e) { } } public static void writeFile(String fileName, String content) { writeFile(fileName, content.getBytes()); } }