Вопрос

FileChannel will faster than BufferedReader, BufferedReader will more faster than Reader because FileChannel and BufferedReader has cut off some itermediate steps to receive data.

My question is : the advantage is obvious, but I don't see any source on web say about its disadvantage. (of FileChannel to BufferedReader, BufferedReader to Reader). What a problem when we cut off intermediate steps between.

So, who can teach me,please.

@:And, the same question for Output, too. Please tell me what disadvantage of those.

thanks :)

Это было полезно?

Решение

One potential disadvantage when using a BufferedWriter (or any of the other buffered output streams) is the fact that your program holds some data in the buffer/in memory before it is written to the output device. If you cannot afford to lose any data in case of a program crash then you may want consider not to use a BufferedWriter/BufferedOutputStream.

Другие советы

I think because when you overcome intermediate steps, data stream will be more easy to meet error. And when errors happen, so difficult to trace bug.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top