字符转换流
1 public static void main(String[] args) throws Exception { 2 // 字符转换编码 3 // 定义一个输出流 4 OutputStream os = new FileOutputStream("src//outInputStream.txt"); 5 // 将原始字节输出流转换成字符输出流 6 Writer osw = new OutputStreamWriter(os,"GBK");// 指定字符编码 7 // 将低级字符流转换成高级字符缓冲输出流 8 BufferedWriter bw = new BufferedWriter(osw); 9 10 bw.write("abc哈喽"); 11 bw.write("abc哈喽"); 12 bw.write("abc哈喽"); 13 bw.close(); 14 }