Java OutputStreamWriter Write saveFile(final File file, final String content)

Here you can find the source of saveFile(final File file, final String content)

Description

save File

License

Open Source License

Declaration

public static void saveFile(final File file, final String content) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void saveFile(final File file, final String content) throws IOException {
        FileOutputStream fos = new FileOutputStream(file);
        final Writer writer = new OutputStreamWriter(fos, "UTF-8");
        writer.write(content);// w ww .ja  va2 s .c om
        writer.close();
        fos.close();
    }
}

Related

  1. save(String fileContent, File file, String encoding)
  2. save(String text, File out)
  3. saveCache()
  4. saveDocument(String path, String textToWrite)
  5. saveFile(File file, String whatToSave, String encoding)
  6. saveFile(String content, File f, String encoding)
  7. saveFile(String fname, String text, String encode)
  8. saveFile(String path, String msg)
  9. saveListString(List list, String filename)