Android Text File Write writeStringToFile(String stringToWrite, String filename)

Here you can find the source of writeStringToFile(String stringToWrite, String filename)

Description

write String To File

Declaration

public static void writeStringToFile(String stringToWrite,
            String filename) throws IOException 

Method Source Code

//package com.java2s;
import java.io.*;

public class Main {
    public static void writeStringToFile(String stringToWrite,
            String filename) throws IOException {
        OutputStream os = new FileOutputStream(filename);
        os.write(stringToWrite.getBytes());
        os.close();//  w ww.  j  a  v a2 s.c  om
    }
}

Related

  1. writeSet2File(Set set, String filePath)
  2. writeString(String string, File file, boolean append)
  3. writeStringToFile(String content, String fileName)
  4. writeStringToFile(String content, String fileName, boolean append)
  5. writeStringToFile(String string, File file)
  6. writeText(File file, String text)
  7. writeText(File file, String text, String charsetName)
  8. writeTextFile(String path, String text)
  9. writeTextFile(String string, String fileName)