| | | | |
字
节 | | ① | | System.in的返回值 | InputStream is = System.in; |
| | | | | |
| java.io.ObjectInputStream | | | | |
| | java.io.BufferedInputStream | | | | |
| A | | | OutputStream os = System.out; |
| | | | | |
| java.io.ObjectOutputStream | | | | |
| | java.io.BufferedOutputStream | | | | |
| | java.io.PrintStream | | 字节打印流 | System.out的返回值 | PrintStream os = System.out; |
字
符 | | | | | |
| java.io.InputStreamReader | ② | 字节流通向字符流的桥梁 | 构造方法参数为 InputStream | InputStreamReader isr = new InputStreamReader(is) |
| | java.io.FileReader | | | | |
| | ③ | 定义该对象的过程是①②③ | 构造方法参数为 Reader | BufferedReader br = new BufferedReader(isr) |
| | | | |
| java.io.OutputStreamWriter | B | 是字符流通向字节流的桥梁 | 构造方法参数为 OutputStream | OutputStreamWriter osw = new OutputStreamWriter(os) |
| | java.io.FileWriter | | | | |
| | C | 定义该对象的过程是 ABC | 构造方法参数为 FileWriter | BufferedWriter bw = new BufferedWriter(osw) |
| | | 字符打印流 | 构造方法参数为
File,OutputStream,
String,Writer | PrintWriter pw = new PrintWriter("a.txt"); |