• FileReader 字符输入流
@Test
public void test2(){
File file = new File("hello.txt");
FileReader fr = null;
try {
fr = new FileReader(file);
char[] cbuf = new char[5];
//返回读取的长度
int len;
while ((len = fr.read(cbuf)) != -1){
String str = new String(cbuf, 0, len);
System.out.print(str);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if (fr != null){
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

  

最新文章

  1. 如何在本地搭建IIS服务器
  2. 玩转CSS3,嗨翻WEB前端,CSS3伪类元素详解/深入浅出[原创][5+3时代]
  3. 【SVN】自动备份SVN仓库
  4. 解决-bash: lsb_release: command not found
  5. sleep()
  6. poj 1190 生日蛋糕
  7. 使用Cookie保存商品浏览记录
  8. Distant Supervision for relation extraction without labeled data
  9. [改善Java代码]推荐使用枚举定义常量
  10. [未完成][Mooc]关于Linxu的总结(一)
  11. php关于private、public成员变量访问问题
  12. 代码生成引擎之T4模版
  13. Codeforces Beta Round #10 B. Cinema Cashier (树状数组)
  14. 2016 ACM/ICPC Asia Regional Qingdao Online
  15. nmon安装(转)
  16. js 去除html标签
  17. javascript四舍五入tofixed
  18. Hibernate第十篇【Hibernate查询详解、分页查询】
  19. php实现MySQL读写分离
  20. MTF 曲线图解读

热门文章

  1. 关于str的打印格式
  2. 郝斌–SQL Server2005学习笔记
  3. SpringBoot学习笔记(六):SpringBoot实现Shiro登录控制和权限控制
  4. poi 3669 meteor shower (bfs)
  5. Python实例2-逗号代码
  6. 提前关闭Scrapy爬虫的设置
  7. CCA Spark and Hadoop 开发者认证技能点【2016只为hadoop达到巅峰】
  8. Django项目:CMDB(服务器硬件资产自动采集系统)--02--02CMDB将服务器基本信息提交到API接口
  9. HDU4004 二分答案
  10. Java 容易疑惑的一些杂记录