Android Text File Write writeToFile(File target, String s, String charSet)

Here you can find the source of writeToFile(File target, String s, String charSet)

Description

write To File

Declaration

public static void writeToFile(File target, String s, String charSet)
            throws FileNotFoundException, IOException,
            UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import java.io.UnsupportedEncodingException;

public class Main {
    public static void writeToFile(File target, String s, String charSet)
            throws FileNotFoundException, IOException,
            UnsupportedEncodingException {
        FileOutputStream fos = new FileOutputStream(target);
        fos.write(s.getBytes(charSet));/*from ww w.java  2s. c  om*/
        fos.close();
    }
}

Related

  1. writeText(File file, String text, String charsetName)
  2. writeTextFile(String path, String text)
  3. writeTextFile(String string, String fileName)
  4. writeTextToFile(String file, String text)
  5. writeToFile(File file, String content)
  6. writeToFile(String content, String filePath)
  7. writeToFile(String sb, String directory, String fileName)
  8. writeToFile(String textToWrite, String fileName)
  9. writeToFile(StringBuffer sb, String directory, String fileName)