IO-STEAM-基础
2015-08-13 14:01
232 查看
定义
先来看java中对于IO中STREAM的定义An I/O Stream represents an input source or an output destination. A stream can represent many different kinds of sources and destinations, including disk files, devices, other programs, and memory arrays.
Stream 是建立在物理资源上的,input source or output destination.
Streams support many different kinds of data, including simple bytes, primitive data types, localized characters, and objects. Some streams simply pass on data; others manipulate and transform the data in useful ways.
Stream 支持不同数据种类。BYTE, CHARACTER, PRIMITIVE DATA TYPES, OBJECTS. 等
输入流
输出流
J***A中Stream类的设计
所以Stream有两个属性,【目标资源】和【数据种类】,根据这两个属性可以对J***A-SE中STREAM分类。J***A-SE中类的设计是,先根据 【数据种类】写一个父类,比如 InputStream。然后根据【目标资源】的不同写一个具体的实现类,比如 FileInputStream 实现对文件的字节读写。
相关文章推荐
- 设计模式:17 适配器模式
- Threading
- 反射——1 通过反射写记事本插件
- oracle pivot
- 抽象工厂模式
- PAT 1027. Colors in Mars (20)
- linux 创建swap分区
- JVM codecache 配置
- Java中的Error和Exceptiond的异同点
- 2-3-RHEL6.3搭建NTP 服务器案例分析与总结(RedHat Enterprise Linux Server6.3)@树袋飘零
- 单例模式3-宏和MRC的严谨
- Xcode/iphone 此证书是由未知颁发机构签名的
- Java中的异常执行顺序
- java中引用
- ActiveMQ持久化方式
- HDU ACM 2007 平方和与立方和
- HDU ACM 2006 求奇数的乘积
- HDU ACM 2005 第几天?
- HDU ACM 2004 成绩转换
- HDU ACM 1008 Elevator