Java OutputStreamWriter Write saveStringToPath(String stringToSave, String pathToSaveTo)

Here you can find the source of saveStringToPath(String stringToSave, String pathToSaveTo)

Description

save String To Path

License

Creative Commons License

Declaration

public static void saveStringToPath(String stringToSave, String pathToSaveTo) 

Method Source Code


//package com.java2s;
//License from project: Creative Commons License 

import java.io.*;

public class Main {
    public static void saveStringToPath(String stringToSave, String pathToSaveTo) {
        try {/*from ww  w.  j av a2s.co  m*/
            OutputStreamWriter oos = new OutputStreamWriter(new FileOutputStream(pathToSaveTo));
            oos.write(stringToSave);
            oos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. saveString(File f, String enc, String text)
  2. saveString(String string, File file, String charsetName)
  3. saveString2File(String s, String filename)
  4. saveStringToFile(String filename, String string)
  5. saveStringToFile(String toSave, String fn)
  6. saveText(BufferedWriter writer, String string)
  7. saveTextInFile(File file, String content, String encoding)
  8. saveTxt(OutputStream os, List list)
  9. saveUnicodeStringToFile(final String string, final File file)