/* Character stream: Filereaderfilewriter. Bufferedreaderbufferedwriter byte stream: Fileinputstreamfileoutputstreambufferedinputstreambufferedoutputstream input a row of data through the keyboard and print its uppercase , the discovery is actually the principle of reading a row of data. That is the ReadLine method. Can you directly use the ReadLine method to complete the reading of a row of data on the keyboard input? The ReadLine method is a method in the character stream BufferedReader class. The Read method of keyboard input is the method of byte stream inputstream. Then can the byte flow into a character stream in the use of character stream buffer ReadLine method? */import java.io.*;class transstreamdemo{public static void Main (string[] args) throws ioexception{//gets the keyboard entry object. InputStream in = system.in;//converts a byte stream object into a character stream object, using the transform stream. Inputstreamreader//inputstreamreader ISR = new InputStreamReader (in);//In order to improve efficiency, the string is efficiently manipulated by buffer technology. Use Bufferedreader//bufferedreader BUFR = new BufferedReader (ISR);//keyboard The most common notation. BufferedReader bufr = new BufferedReader (new InputStreamReader (system.in));//outputstream out = system.out;// OutputStreamWriter OSW = new OutputStreamWriter (out);//bufferedwriter BUFW = new BufferedWriter (OSW); BufferedWriter BUFW = new BufferedWriter (new OutputStreamWriter (System.out)); String line = Null;while ((Line=bufr.readline ())!=null) {if (' over '). EquaLS (line)) Break;bufw.write (Line.touppercase ()); Bufw.newline (); Bufw.flush ();} Bufr.close ();}}
java-buffer flow to input packaging