Scanner vs InputStreamReader

前端 未结 3 1000
迷失自我
迷失自我 2020-12-29 08:53

Does anyone happen to know if there is any difference with regards to performance between the two methods of reading input file below? Thanks.

1) Reading a file wit

3条回答
  •  无人及你
    2020-12-29 09:29

    A difference, and the principal, I guess, is that with the BufferedReader/InputStreamReader you can read the whole document character by character, if you want. With scanner this is no possible. It means that with the InputStreamReader you can have more control about the content of the document. ;)

提交回复
热议问题