1、BufferedReader
从输入字符流中读取文本,缓冲各个字符,从而实现字符,数组和行的读取。
构造函数 BuffferedReader(reader)
reader 为InputStreamReader.它是安装指定的编码(如GBK)将二进制流转换为字符流。
构造函数
InputStreamReader(InputStream in) Creates an InputStreamReader that uses the default charset. |
InputStreamReader(InputStream in, Charset cs) Creates an InputStreamReader that uses the given charset. |
InputStreamReader(InputStream in, CharsetDecoder dec) Creates an InputStreamReader that uses the given charset decoder. |
InputStreamReader(InputStream in, String charsetName) Creates an InputStreamReader that uses the named charset. |
2、BufferedWriter
输入流:将文本写入字符输出流,缓冲各个字符,从而提供单个字符、数组和字符串的高效写入
构造函数 BufferedWriter(Writer out)
Writer子类
BufferedWriter, CharArrayWriter, FilterWriter, OutputStreamWriter, PipedWriter, PrintWriter, StringWriter