Here you can find the source of saveString(File f, String enc, String text)
public static void saveString(File f, String enc, String text) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { public static void saveString(File f, String enc, String text) throws IOException { OutputStreamWriter osw = null; try {// w w w . j a v a 2 s .com osw = new OutputStreamWriter(new FileOutputStream(f), enc); osw.write(text); osw.flush(); } finally { if (osw != null) { osw.close(); } } } }