标签:设置 指定 关闭 div flush log pre class writer
使用这种方式,当指定的文件不存在时会自动创建。
//此处设置为true即可追加
FileWriter out = new FileWriter("D:\\1.txt",true);
//往文件写入
out.write("abc");
//换行
out.write("\r\n");
//继续追加
out.write("def");
//刷新IO内存流
out.flush();
//关闭
out.close();
标签:设置 指定 关闭 div flush log pre class writer
原文地址:http://www.cnblogs.com/it-deepinmind/p/7429337.html