| Author |
file i/o doubt ?
|
gurpeet singh
Ranch Hand
Joined: Apr 04, 2012
Posts: 867
|
|
please refer kb6 book page 452. following is portion from the page
i'm having doubts on comments. it says that BufferedReader gets its data from a reader which gets its data from file. but then what is the function of Bufferedreader. it was supposed to read large chunks of data and save costly i/o read disk operations. but here it says that BufferedReader reads data from reader.still filereader has to read data from file character by character .please explain me where i'm wrong ?
|
OCPJP 6(100 %) OCEWCD 6(91 %)
|
 |
saloni jhanwar
Ranch Hand
Joined: Feb 09, 2012
Posts: 583
|
|
|
see Class BufferedReader
|
Tell the difficulties that i am difficult.
|
 |
Praveen Kumar M K
Ranch Hand
Joined: Jul 03, 2011
Posts: 256
|
|
|
I'll give you a practical example. When transporting bigger objects(Example : File) across network, due to unforeseen circumstances, there is chance when bytes get lost or get corrupted. Due to this, at the receiver end, even with proper header information the receiver would not be able to reconstruct the input object to its whole. This is where we use buffered streams wherein a bigger object can be easily built back at the receiver.
|
 |
 |
|
|
subject: file i/o doubt ?
|
|
|