关于OutputStreamWriter和InputStreamReader的疑问
看了一下API文档
An OutputStreamWriter is a bridge from character streams to byte streams OutputStreamWriter是将字符流转换为字节流,为什么构造函数接收的是字节流而不是字符流 如下 OutputStreamWriter(OutputStream out, Charset cs)
An InputStreamReader is a bridge from byte streams to character streams 这个InputSteamWriter是按着指定的字符集或默认的字符集将字节流留转换为字符流, 如下 InputStreamReader(InputStream in, Charset cs)
InputStreamReader就是接受字节流 进而转为字符流 可是为什么outputStream不接受字符流 进而转化为字节流呢?
|