Difference between BufferedReader and BufferedInputStream

徘徊边缘 提交于 2019-11-29 05:52:39

问题


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.



来源:https://stackoverflow.com/questions/10434736/difference-between-bufferedreader-and-bufferedinputstream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!