package IODemo;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException; public class OutputStreamAndInputStream { /**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
demo1();
demo2();
demo3();
} private static void demo3() throws IOException {
FileInputStream fis = new FileInputStream("Demo.txt");
byte buf[] = new byte[10];
int len = 0;
while ((len = fis.read(buf)) != -1) {
System.out.println(new String(buf, 0, len));
}
} private static void demo2() throws IOException {
FileOutputStream fos = new FileOutputStream("Demo.txt");
fos.write("abcd".getBytes());
} private static void demo1() throws IOException {
FileInputStream fis = new FileInputStream("Demo.txt");
int ch = 0;
while ((ch = fis.read()) != -1) {
System.out.println((char) ch);
}
} }

最新文章

  1. ORA-00942:table or view does not exist
  2. easyUI datagraid的列排序
  3. repeater 根据输入 返回汉字
  4. MongoVUE
  5. mac OS X操作 -- 常用
  6. c++ map 的基本操作
  7. Android——数据库相关(课堂整理)
  8. DIOCP之数据接收事件
  9. JSTL 核心标签库
  10. Http 信息头
  11. (7)基于hadoop的简单网盘应用实现3
  12. Python的多线程GIL浅谈
  13. lookup_peer.go
  14. springmvc简单的流程说明及源码分析
  15. Junit概述
  16. 调试 - Visual Studio调试
  17. C#实时检测端口占用情况
  18. 【CUDA并行程序设计系列(1)】GPU技术简介
  19. Spring boot发送邮件
  20. “取件帮”微信小程序宣传视频链接及内容介绍

热门文章

  1. poj The Clocks 高斯消元
  2. win8.1下使用vmware workstation 来编译ffmpeg
  3. ???????????? no permissions
  4. POJ 3252 Round Numbers(数位dp)
  5. SRM 585 DIV1 L2
  6. Uploadify 控件上传图片 + 预览
  7. 51nod水题记
  8. POJ 3678 Katu Puzzle (2-SAT,常规)
  9. LeetCode Excel Sheet Column Title (输出excel表的列名称)
  10. 【转】蓝牙ble app开发(三) -- 抓包