1. 梗概:
数据流特别在可以识别流中的数据类型
2. 类中常用方法:
1. 以数据输入流为例, 输出流类似:
1.1. 普通的按字节读取:
2.1.1.1. public final int read(byte[] r, int off, int len)throws IOException
从所包含的输入流中将 len 个字节读入一个字节数组中。如果len为-1,则返回已读字节数。
2.1.1.2. Public final int read(byte [] b)throws IOException
从所包含的输入流中读取一定数量的字节,并将它们存储到缓冲区数组 b 中。
1.2. 按指定数据类型读取:
2.1.2.1. public final Boolean readBooolean()throws IOException,
2.1.2.2. public final byte readByte()throws IOException,
2.1.2.3. public final short readShort()throws IOException
2.1.2.4. public final Int readInt()throws IOException
从输入流中读取字节,返回输入流中两个字节作为对应的基本数据类型返回值。
2.1.2.5. public String readLine() throws IOException
从输入流中读取下一文本行