基本的io流主要是java.io.OutputStream,java.io.InputStream,Writer,Reader


1、从字节流向字符流转化中Reader的 InputStreamReader和OutputStreamReader起着重要的作用。
 另外 Reader reader = (new InputSource(InputStream input)).getCharacterStream();

2、从字符流向字节流转化 
InputStream is = (new InputSource(Reader reader)).getByteStream();



 

java.io.Reader
   BufferedReader         //new BufferedReader(new FileReader(filePath))
   InputStreamReader      //InputStreamReader(InputStream in) ,InputStreamReader(InputStream in, CharsetDecoder dec)

 

java.io.Writer
   BufferedWriter        //new BufferedWriter(new FilterWriter(filePath))
   OutputStreamWriter
   PrintWriter           //PrintWriter(OutputStream out), PrintWriter(Writer out, boolean autoFlush)








【注】

InputSource(InputStream byteStream)
          Create a new input source with a byte stream.
InputSource(Reader characterStream)
          Create a new input source with a character stream.
InputSource(String systemId)
          Create a new input source with a system identifier.
 
Method Summary
 InputSource getByteStream()
          Get the byte stream for this input source.
 Reader getCharacterStream()