Android String to File Write writeFile(List input, String inputFileName)

Here you can find the source of writeFile(List input, String inputFileName)

Description

write File

Declaration

static public void writeFile(List<String> input, String inputFileName)
            throws IOException 

Method Source Code

//package com.java2s;

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

import java.util.List;

public class Main {
    static public void writeFile(List<String> input, String inputFileName)
            throws IOException { 
        FileOutputStream inputfos = new FileOutputStream(inputFileName);
        for (String line : input) {
            inputfos.write(line.getBytes("UTF-8"));
            inputfos.write('\n');
        }//from   w  ww.  j  a va  2  s.  c om
        inputfos.close();
    }
}

Related

  1. appendTextToFile(String file, String text)