该实例为不断的给流通道加包装,提高程序读取的效率。
import java.io.*;
public class hehe {
public static void main(String args[]){
InputStreamReader is =
new InputStreamReader(System.in);
BufferedReader iss =
new BufferedReader(is);
try{
String str;
str = iss.readLine();
while(str!=null){
if(str.equals("exit")) break;
System.out.println(str.toUpperCase());
str = iss.readLine();
}
}catch(Exception e){
e.printStackTrace();
}
}
}