Here you can find the source of writeString(File file, String str, String encoding)
public static void writeString(File file, String str, String encoding) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static void writeString(File file, String str, String encoding) throws IOException { try (Writer out = new OutputStreamWriter(new FileOutputStream(file), encoding)) { out.write(str);/* w w w . j av a2 s. co m*/ } } }