Spurs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在编译的时候只有写出rw之后使用alt+/就可以将模板代码全部展现出来。

rw读写模板代码:

InputStream in = null;
OutputStream out = null;
try {
  in = new FileInputStream(path);
  int len = 0;
  byte[] buffer = new byte[1024];
  out = new FileOutputStream("");
  while ((len = in.read(buffer)) > 0) {
    out.write(buffer, 0, len);
  }
} finally {
  if (in != null) {
    try {
      in.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  if (out != null) {
    try {
      out.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

MyEclipse设置模板方式:http://www.jb51.net/softjc/486530.html

posted on 2018-04-19 22:47  英雄与侠义的化身  阅读(195)  评论(0编辑  收藏  举报