一、IO流分类
1、流向: 输入流与输出流
2、数据:字节流:二进制,可以一切文件 包括 纯文本 doc 音频、视频等等
    字符流:文本文件,只能处理纯文本
二、字符流与字节流 (重点) 与文件
1、字节流
输入流:InputStream read(byte[] b) 、read(byte[] b, int off, int len) +close()
    FileInputStream()
输出流:OutputStream write(byte[] b) write(byte[] b, int off, int len) +flush() +close()
    FileOutputStream
2、字符流
输入流:Reader read(char[] cbuf) read(char[] cbuf, int off, int len) +close()
    FileReader()
输出流:Writer write(char[] cbuf) write(char[] cbuf, int off, int len) +flush() +close()
    write(String str, int off, int len)
    FileWriter()
三、操作
1、建立联系
2、选择流
3、操作 数组大小+read 、write
4、释放资源

相关文章:

  • 2021-11-25
  • 2021-11-04
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-06
  • 2021-04-25
  • 2022-01-21
  • 2021-08-03
  • 2021-10-10
  • 2022-01-18
相关资源
相似解决方案