Here you can find the source of writeFile(String fileName, String source)
private static void writeFile(String fileName, String source) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; import java.io.IOException; public class Main { private static void writeFile(String fileName, String source) throws IOException { FileWriter fos = new FileWriter(fileName); for (int i = 0; i < source.length(); i++) { fos.write(source.charAt(i)); }/*from w w w . ja va 2 s.co m*/ fos.close(); return; } }