Android Text File Write writeFile(String filePath, String content)

Here you can find the source of writeFile(String filePath, String content)

Description

write File

Declaration

public static void writeFile(String filePath, String content)
        throws Exception 

Method Source Code

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

public class Main {

    public static void writeFile(String filePath, String content)
            throws Exception {
        FileOutputStream outSTr = new FileOutputStream(new File(filePath));
        BufferedOutputStream Buff = new BufferedOutputStream(outSTr);
        Buff.write(content.getBytes());/*from w w w.j  av a 2s .c  o  m*/
        Buff.flush();
        Buff.close();
    }
}

Related

  1. writeFile(OutputStream output, String text)
  2. writeFile(String file, T data, boolean append)
  3. writeFile(String fileName, String content)
  4. writeFile(String fileName, String text)
  5. writeFile(String fileName, String text, boolean isAppend)
  6. writeFileAsString(File file, String text)
  7. writeFileAsString(File file, String text, String encoding)
  8. writeFileAsString(String filename, String text)
  9. writeFileAsString(String filename, String text, String encoding)