Difference between BufferedReader and BufferedInpu

2020-02-24 12:40发布

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?

2条回答
家丑人穷心不美
2楼-- · 2020-02-24 13:16

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

查看更多
3楼-- · 2020-02-24 13:26

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.

查看更多
登录 后发表回答