zoukankan      html  css  js  c++  java
  • Java复习之IO

    一、File类

    1. File 类的作用

    2. File类中的方法对文件进行操作

    File类是唯一与文件本身有关的类

    二、RandomAccessFile类

    1. RandomAccessFile类的作用

    2. RandomAccessFile 读取指定位置的数据 

    close(); read();readByte();seek();writeBytes;writeInt();skipBytes()

    三、字节流与字符流

    1. 流的概念

    流中保存的是字节文件

    2. 字节流与字符流的作用

    字节流: OutputStream & InputStream

    字符流: Writer & Reader

    3. 文件的标准操作步骤

    字节流主要操作byte类型数据:FileOutputStream;FileInputStream

    字符流操作一个字符等于2个字节:FileWriter;FileReader

    4. 字节与字符操作的区别

    字节流在操作的时候本身是不会用到缓冲区(内存)的,是与文件本身直接操作的

    字符流在操作的时候用到缓冲区

    四、字节-字符转换流

    OutputStreamWriter :Writer 的子类,将输出的字符流变为字节流

    InputStreamReader:Reader的子类,将输入的字节流变为字符流

    五、内存操作流

    ByteArrayInputStream:将内容写入到内存

    ByteArrayOutputStream:将内存中的数据输出

    六、管道流

    线程通讯流(管道流)的使用

    PipedOutputStream:管道输出流

    PipedInputStream:管道输入流

    七、打印流

    1. 打印流操作 (装饰设计模式)

    字节打印流:PrintStream

    字符打印流:PrintWriter

    2. 格式化输出

    八、System类对IO的支持

    1. 三种支持;

    System.out;System.err;System.in

    2. System.out 与System.err的区别

    3. 掌握输入,输出重定向

    九、BufferedReader

    1. BufferedReader 类:从缓冲区中读内容

    2. 键盘输入的基本形式

    十、Scanner

    1. Scanner类的作用

    在java.util包中 是一个工具类

    2. Scanner接收输入数据

    十一、数据操作流

    1. DataOutputStream:继承了FilterOuputStream实现类DataOuput接口

    2. DataInputStream

    十二、合并流

    SequenceInputStream类

    十三、压缩流

    1. 压缩流的主要作用

    2. 三种压缩格式

    3. ZipOutputStream,ZipFile,ZipInputStream三个类的作用

    十四、回退流

    1. 回退流工作原理

    回退:给用户第二次读的机会

    2. PushbackInputStream类

    字节回退流:PushbackInputStream

    字符回退流:PushbackReader

    十五、字符编码

    iso

    GBK/GB2312

    unicode

    UTF

    十六、对象序列化

    1. 对象序列化的作用

    2. Serializable 接口的作用

    3. ObjectOuputStream序列化操作

    4. ObjectInputStream 番序列化操作

    serialVersionUID常量

    5. Externalizable 接口的作用

    6. transient关键字

    7. 序列化一组对象

  • 相关阅读:
    Linux 一条命令批量关闭子进程
    Ubuntu18.08+php7 apache2不解析php文件解决方法
    Python ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
    python报错 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
    Python封装为可执行程序
    PHP-FPM 远程代码执行漏洞(CVE-2019-11043)的简单复现学习
    多事之秋,随便记点东西
    泛微e-cology OA系统某接口存在数据库配置信息泄露漏洞复现
    对vuex的浅解
    vuejs验证码
  • 原文地址:https://www.cnblogs.com/wenjing-coding/p/4763463.html
Copyright © 2011-2022 走看看