转换流只能从字节流转为字符流,不能往回转
转换流指的是:字节流——>字符流
1、OutputStreamWriter(字节输出流——>字符输出流)
public class OutputStreamWriter extends Writer
构造方法:public OutputStreamWriter(OutputStream out)
public OutputStreamWriter(OutputStream out,StringcharsetName) throws UnsupportedEncodingException
2、InputStreamReader(字节输入流——>字符输入流)
字符流的具体子类大都是通过转换流将字节流转为字符流(FileWriter继承转换流)
比如:public class FileWriter extends OutputStreamWriter