public class Test {

    public static void main(String[] args) {

        method1("F:\\test.txt" , "测试测试将字符写入文件默默");
} /**
* 追加文件:使用FileOutputStream,在构造FileOutputStream时,把第二个参数设为true
*
* @param fileName
* @param content
*/
public static void method1(String file, String conent) {
BufferedWriter out = null ;
try {
out = new BufferedWriter( new OutputStreamWriter(
new FileOutputStream(file, true )));
out.write(conent);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

最新文章

  1. 安装 Dubbo 管理控制台
  2. nginx的内存管理
  3. tomcat Manger App
  4. Ibatis,Spring整合(注解方式注入)
  5. VS2010的调试参数/Zi /DEBUG
  6. JAVA中的Formatter
  7. 《k8s 源码分析》- Custom Controller 之 Informer
  8. PADS Logic VX.2.3 修改软件界面语言
  9. hduoj 1002 A + B Problem II
  10. (转)Spring boot(一):入门篇
  11. BZOJ3963 WF2011MachineWorks(动态规划+斜率优化+cdq分治)
  12. JQuery ajax请求返回(parsererror)异常处理
  13. UDP和TCP的比較
  14. centos7 修改时区
  15. NOIP2017 D2T3列队
  16. C++复习11.函数的高级特性
  17. [Linux] ubuntu 安装 Wireshark
  18. laravel支持的日志写入模式和日志严重程度级别:
  19. Effective Objective-C [上]
  20. 2017浙江工业大学-校赛决赛 XiaoWei的战斗力

热门文章

  1. 汉明码(Hamming Code)原理及实现
  2. vs2005无法附加到进程 系统找不到文件
  3. Some tricks
  4. Git - revert详解
  5. 共享服务-FTP基础(二)
  6. Linux菜鸟起飞之路【十】进程管理
  7. Linux常用快捷键以及如何查看命令帮助
  8. python爬虫集合
  9. FSMC原理通俗解释
  10. 如何生成带注释的DLL文件