IO stream classification
字节流:FileInputstream (继承自InputStream),StringBufferInputStream(从字符串里读取Byte源数据)
字符流:Reader(Abstract class,implements Readable,Closeable),subclass must implements read(char[],int,int),read into a portion of array.
Buffered Reader:Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.
InputStreamReader:bridge from bytestream to character stream.
FileReader(File file/filedescriptor/String filename):read(char[],int,int):read characters into a portion of array.
For top efficiency, consider wrapping an InputStreamReader within a BufferedReader. For example:BufferedReader in= new BufferedReader(new InputStreamReader(System.in);
字节流:
InputStream()方法:
read():for read 1 byte, read(byte[])for read some number of bytes into buffer. read(byte[], int start, int len):for read len bytes start from start position.