2013年9月10日星期二

Both spellings What difference does it make ?

1 ,
BufferedInputStream bin = new BufferedInputStream (System.in);
InputStreamReader insr = new InputStreamReader (bin);
BufferedReader br = new BufferedReader (insr);
String str = br.readLine ();


2,

InputStreamReader insr = new InputStreamReader (in);
BufferedReader br = new BufferedReader (insr);
String str = br.readLine ();
------ Solution ------- -------------------------------------
BufferedInputStream byte-oriented , you read the normal file will be garbled
InputStreamReader is character-oriented , can be used to read the file
------ Solution ---------------------- ----------------------
BufferedInputStream all buffered data is cached in the byte array , and for other ways to use space for time , if not the buffer must be re- bytes from the input stream to read , time efficiency will be greatly reduced. We set a BufferedInputStream is to improve the output efficiency
------ Solution ------------------------------- -------------
BufferedInputStream should be to increase the efficiency of input bytes

没有评论:

发表评论