Android Text File Write writeFileSdcard(File file, String message)

Here you can find the source of writeFileSdcard(File file, String message)

Description

write File Sdcard

Declaration

public static void writeFileSdcard(File file, String message)
            throws Exception 

Method Source Code

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

import java.io.FileOutputStream;

public class Main {
    public static void writeFileSdcard(File file, String message)
            throws Exception {
        FileOutputStream fout = new FileOutputStream(file);
        byte[] bytes = message.getBytes("UTF-8");
        fout.write(bytes);/* w ww  .j  av  a2s.  c o m*/
        fout.flush();
        fout.close();
    }
}

Related

  1. writeToFile(String sb, String directory, String fileName)
  2. writeToFile(String textToWrite, String fileName)
  3. writeToFile(StringBuffer sb, String directory, String fileName)
  4. writeToFile(final String path, final String content)
  5. saveFile(String content, File file)
  6. writeFile(String filepath, String text)
  7. writeStringToFile(String text, String filePath)
  8. writeToSDFile(String directory, String file_name, String text)
  9. writeFileEnd(String filepath, String text)