public static void main(String[] args) {

         FileWriter fw = null;
         try {
             fw = new FileWriter("/Users/weianlai/demo");
             fw.write("这是一个demo");
             fw.flush();
         } catch (IOException e) {
             e.printStackTrace();
         } finally {
             if (fw != null) {
                 try {
                     fw.close();
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
             }
         }

         FileReader fr = null;
         try {
             fr = new FileReader("/Users/weianlai/demo");
             char[] buf = new char[1024];
             int num = 0;
             while ((num = fr.read(buf)) != -1) {
                 System.out.println(new String(new String(buf, 0, num)));
             }
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
             if (fr != null) {
                 try {
                     fr.close();
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
             }
         }

     }

最新文章

  1. vs2010统计项目代码总行数
  2. 数据库视图 (View)和EntityFramework Code First结合使用
  3. 移动前端页面与Chrome的远程真机调试
  4. Why NHibernate updates DB on commit of read-only transaction
  5. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.3.6
  6. Sass函数--字符串函数
  7. apache2.4.x三种MPM介绍
  8. oracle习题1~13
  9. MapReduce运行流程分析
  10. Angular - Templates(模板)
  11. golang实现权重轮询调度算法
  12. sql中的常见报错;
  13. easyui-combobox的option选项为true与false时的问题
  14. Subarray Sums Divisible by K LT974
  15. 2019.01.09 bzoj2599: [IOI2011]Race(点分治)
  16. 系统启动时队列自动下单--ServletContextListener
  17. 怪奇物语第二季/全集Stranger Things迅雷下载
  18. DataFrame在算术方法中填充值
  19. OpenNI检测不到Kinect Camera和Kinect Audio了
  20. Linux 批量管理工具

热门文章

  1. UGUI Auto Layout 自动布局
  2. 迷你MVVM框架 avalonjs 学习教程18、一步步做一个todoMVC
  3. linux安装本地blast
  4. Hibernate使用固定值关联表
  5. Python3 List list()方法
  6. keras—多层感知器识别手写数字算法程序
  7. Dungeon Game (GRAPH - DP)
  8. 最小重组缓冲区和路径MTU发现
  9. fiddler抓web请求
  10. Notepad++正则表达式格式 Editplus使用正则表达式[转]