编码字符流
2019-04-17 / JAVA / 905 次围观 / 0 次吐槽 /InputStreamReader
这个类用于使用指定的码表读写字符
/** charsetName:字符编码的名称 */ FileInputStream fis = new FileInputStream("a.txt"); InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); BufferedReader br = new BufferedReader(isr);
OutputStreamWriter
这个类使用指定的编码 写入文件
FileOutputStream fos = new FileOutputStream("c.txt"); OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK"); BufferedWriter bw = new BufferedWriter(osw);
- 上一篇:装饰(Decorator)设计模式
- 下一篇:递归
Powered By Cheug's Blog
Copyright Cheug Rights Reserved.