Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileReader and FileInputStream
 
Similar Threads
FileReader
About IO!
binary files and char []
why a byte cant be assigned to a char?
Understanding Byte Data and Character Encoding