Here you can find the source of saveTxt(String line, String filename, boolean isEndSave)
public static void saveTxt(String line, String filename, boolean isEndSave)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; public class Main { public static void saveTxt(String line, String filename, boolean isEndSave) { try {/*from w w w .ja v a 2 s . com*/ FileWriter file = new FileWriter(filename, isEndSave); BufferedWriter writer = new BufferedWriter(file); writer.write(line); writer.newLine(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }