java - Specific difference between bufferedreader and filereader -


i know specific difference between bufferedreader , filereader.

i know bufferedreader more efficient opposed filereader, can please explain why (specifically , in detail)? thanks.

in simple manner:

a filereader class general tool read in characters file. bufferedreader class can wrap around readers, filereader, buffer input , improve efficiency. wouldn't use 1 on other, both @ same time passing filereader object bufferedreader constructor.

very detail

filereader used input of character data disk file. input file can ordinary ascii, 1 byte per character text file. reader stream automatically translates characters disk file format internal char format. characters in input file might other alphabets supported utf format, in case there 3 bytes per character. in case, also, characters file translated char format.

enter image description here

as output, practice use buffer improve efficiency. use bufferedreader this. same class we've been using keyboard input. these lines should familiar:

bufferedreader stdin =     new bufferedreader(new inputstreamreader( system.in )); 

these lines create bufferedreader, connect input stream keyboard, not file.

source: http://www.oopweb.com/java/documents/javanotes/volume/chap84/ch84_3.html


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -