2013年12月7日
摘要: 1,明确源和目的 源InputStream Reader 目的OutputStream Writer2,明确数据是否为纯文本数据 源:是纯文本:Reader 否:InputStream 目的:是否文本:Writer 否:OutputStream 这里就可以明确需求中具体要使用哪个体系 3,明确具体的设备 源设备: 硬盘:File 键盘:System.in 内存:数组 网络:Socket流 目的设备: 硬盘:File 控制台:System.out 内存:数组 网络:Socket流 4,是否需要其他额外功能 1,是否需要高效(缓冲区) 是,就加上Buffer 阅读全文
posted @ 2013-12-07 15:54 ざ柒 阅读(134) 评论(0) 推荐(0)
摘要: 1 //创建容器 2 StringBuilder sb=new StringBuilder(); 3 //获取键盘读取流 4 InputStream in=System.in; 5 //定义变量记录读取到的字节,并循环获取 6 int ch=0; 7 while((ch=in.read())!=-1){ 8 if(ch=='\r') 9 continue;10 if(ch=='\n'){11 ... 阅读全文
posted @ 2013-12-07 11:08 ざ柒 阅读(257) 评论(0) 推荐(0)