Java OutputStreamWriter Write saveString(File f, String enc, String text)

Here you can find the source of saveString(File f, String enc, String text)

Description

save String

License

Apache License

Declaration

public static void saveString(File f, String enc, String text) throws IOException 

Method Source Code

//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();
            }
        }
    }
}

Related

  1. saveFile(String fname, String text, String encode)
  2. saveFile(String path, String msg)
  3. saveListString(List list, String filename)
  4. saveListText(String filename, List array)
  5. saveLongTxtList(long[] ids, String[] texts, String listFile)
  6. saveString(String string, File file, String charsetName)
  7. saveString2File(String s, String filename)
  8. saveStringToFile(String filename, String string)
  9. saveStringToFile(String toSave, String fn)