What are the differences between BufferedReader
, BufferedInputStream
and Scanner
in java? BufferedReader
reads the text and BufferedInputStream
reads byte
. Is there any difference other than this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I guess, the difference is the same as between reader and inputstream: one is character-based, another is byte-based. For example, reader normally supports encoding...
Edit: Check this question: The difference between InputStream and InputStreamReader when reading multi-byte characters
回答2:
BufferedInputStream
reads the data in the buffer as bytes by using InputStream
. BufferedReader
reads the text but not as bytes and BufferedReader
is efficient reading of characters,arrays and lines.