Java BufferedWriter Write writeFile(String file, List data)

Here you can find the source of writeFile(String file, List data)

Description

write File

License

Open Source License

Declaration

public static void writeFile(String file, List<String> data) throws IOException 

Method Source Code


//package com.java2s;

import java.io.BufferedWriter;

import java.io.FileWriter;
import java.io.IOException;

import java.util.List;

public class Main {
    public static void writeFile(String file, List<String> data) throws IOException {
        BufferedWriter out = new BufferedWriter(new FileWriter(file));
        for (String line : data) {
            out.write(line);// w  ww  . j a v a  2s  .c  o m
            out.newLine();
        }
        out.close();
    }
}

Related

  1. writeFile(File src, File dst)
  2. writeFile(Object msg)
  3. writeFile(String dir, String file, String content)
  4. writeFile(String directory, String content, String fileName, boolean deleteFileBeforeWriting)
  5. WriteFile(String file)
  6. writeFile(String filename, ArrayList entries)
  7. writeFile(String filename, Map map)
  8. writeFile(String line, File file)
  9. writefile(String m, String path)