This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes FileReader and FileInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "FileReader and FileInputStream" Watch "FileReader and FileInputStream" New topic

FileReader and FileInputStream

abhay jain
Ranch Hand

Joined: Jun 03, 2011
Posts: 130
FileReader class reads 16 bit character, FileInputStream class used for 8 bit byte

can you please give me an example that how this 8 and 16 bit or byte and char difference can matter to a program's ability of reading
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Readers read characters. Streams read bytes. They do to two different things. One cannot be used instead of the other.

So it has nothing to do with the readability of your program. It's about which functionality is required.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
It is sorta covered in the JavaRanch Style Guide.
subject: FileReader and FileInputStream