日期:2014-05-20  浏览次数:20909 次

IO流心得
一、IO流的三种分类方式

 
  1.按流的方向分为:输入流和输出流

 
  2.按流的数据单位不同分为:字节流和字符流

 
  3.按流的功能不同分为:节点流和处理流

 
  二、IO流的四大抽象类:

 
  字符流:Reader Writer

 
  字节流:InputStream(读数据)

 
  OutputStream(写数据)

 
  三、InputStream的基本方法

 
  int read() throws IOException 读取一个字节以整数形式返回,如果返回-1已到输入流的末尾

 
  void close() throws IOException 关闭流释放内存资源

 
  long skip(long n) throws IOException 跳过n个字节不读

 
  四、OutputStream的基本方法

 
  void write(int b) throws IOException 向输出流写入一个字节数据

 
  void flush() throws IOException 将输出流中缓冲的数据全部写出到目的地

 
  五、Writer的基本方法

 
  void write(int c) throws IOException 向输出流写入一个字符数据

 
  void write(String str) throws IOException将一个字符串中的字符写入到输出流

 
  void write(String str,int offset,int length)

 
  将一个字符串从offset开始的length个字符写入到输出流

 
  void flush() throws IOException 

 
  将输出流中缓冲的数据全部写出到目的地

 
  六、Reader的基本方法

 
  int read() throws IOException 读取一个字符以整数形式返回,如果返回-1已到输入流的末尾

 
  七、节点流类型

 
  八、访问文件之FileInputStream和FileOutputStream继承基类用于向文件中输入输出字节

北大青鸟鲁广校区 牛老师指导

------解决方案--------------------

------解决方案--------------------
不明白意思。。

------解决方案--------------------
学习了。。。
------解决方案--------------------
探讨
不明白意思。。