1.归类划分 (1)以数据流的方向划分为:输入流与输出流。 (2)以数据流的传输单位划分为:字节流与字符流。 (3)以数据流的处理方式划分为:节点流和处理流。 2.用表格形式表示四种抽象类: | 字节流 | 字符流 | 输入流 | InputStream | Reader | 输出流 | OutputStream | Writer |
3.(1)InputStream(输入字节流)的子类包括: 输入节点流 | 输入处理流 | | FileInputStream | FilterInputStream----派生à | LineNumberInputStream | PipedInputStream | SequenceInputStream | DataInputStream | ByteArrayInputStream | ObjectInputStream | BufferedInputStream | StringBufferInputStream | | PushbackInputStream |
(2)OutputStream(输出字节流)的子类包括: 输出节点流 | 输出处理流 | | FileOutputStream | FilterOutputStream----派生à | DataOutputStream | PipedOutputStream | ObjectOutputStream | BufferedOutputStream | ByteArrayOutputStream | | PrintStream |
4.处理字符流(处理流是套接在其它节点流之外的流类型) 字符流 | 字节流 | BufferedReader | BufferedInputStream | BufferedWriter | BufferedOutputStream | FilterReader | FilterInputStream | FilterWriter | FilterOutputStream | InputStreamReader | ObjectInputStream | OutputStreamWriter | ObjectOutputStream | LineNumberReader | LineNumberInputStream | PushbackReader | PushbackInputStream | PrintWriter | PrintStream | | DataInputStream | | DataOutputStream |
*忠告:在编写Java IO程序时,好的编程习惯是在向外写入数据时,在调用Close之前最好先flush数据。
|