InputStream, OutputStream
The abstract class that handles the byte stream, InputStream can read a byte from the source, so it is the lowest level. InputStream is a superclass of all classes of byte input streams, generally we use its subclasses, such as FileInputStream, etc.
InputStreamReader OutputStreamWriter
The abstract class that handles the character stream is a bridge of bytes flowing to the character stream, which converts the byte stream into a character stream. It reads one character at a time in a higher-level manner.
BufferedReader BufferedWriter
BufferedReader is more advanced than InputStreamReader and reads one line at a time.
InputStream is a byte-by-byte read, each time the read will execute an IO, we know that the operation of the IO is very time-consuming, which will inevitably lead to the efficiency of the program, and bufferedreader a good solution to this problem, it can read a large number of data, Greatly reduce the number of Io, efficiency is up
Three layers of progressive, so we often see this use:
FileInputStream fis=New FileInputStream ("D://desktop//test.txt");
InputStreamReader isr=New InputStreamReader (FIS,"UTF8");
BufferedReader br=New BufferedReader (ISR);
Get input to the keyboard:
BufferedReader bufr = new BufferedReader (new InputStreamReader (system.in));
Similar to scanner, but more powerful than scanner, because scanner cannot get input with a space, enter key
JAVA IO InputStream InputStreamReader BufferedReader