25

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?

Ashish Kumar
  • 816
  • 2
  • 14
  • 31
user1357722
  • 5,598
  • 12
  • 32
  • 41

2 Answers2

18

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

Community
  • 1
  • 1
Igor Deruga
  • 1,452
  • 1
  • 10
  • 17
9

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.

Ashish Kumar
  • 816
  • 2
  • 14
  • 31
Kumaresh Babu
  • 91
  • 1
  • 1