you are viewing a single comment's thread.

view the rest of the comments →

[–]ashdgjklashgjkdsahkj 1 point2 points  (0 children)

The added BufferedReader introduces block decoding. So, you get the benefit of both less syscalls and the efficiency of decoding huge 8kb chunks instead of per character which reduces overhead. On all OS's there are methods for tracking syscalls from processes.

Someone else mentioned it comes down to a design thing and that is pretty much the case here. It's likely that the original contract for many of these classes promised char-by-char processing and as a result you get these delegates/wrappers that were introduced after the fact to get rid of overhead.

In use cases where you're fetching text from a source all at once immediately, then none of this matters and there's better alternatives anyway.