• Post Reply Bookmark Topic Watch Topic
  • New Topic

FileReader vs FileInputStream

 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please let me know the difference between FileReader and FileInputStream. Which one to use and when?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Readers and Writers are for character (text) I/O, while Streams are for binary I/O. Those may at times appear to be the same thing (text can be handled using streams, too), but every time a Reader/Writer is used one needs to think about handling encoding/decoding issues. Using streams one can focus on handling bytes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!