aspose file tools*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "FileReader and FileInputStream" Watch "FileReader and FileInputStream" New topic
Author

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