SiteMap  | About    

FileReader Class

How to use Java FileReader Class

FileReader is character-oriented class which is used for file handling in Java. It is meant for reading streams of characters. One character may correspond to one or more bytes depending on the character encoding scheme .

Character Encoding

Java FileReader Class Character Encoding

This Class assumes that you want to decode the bytes in the file using the default character encoding for the program is running on. This may not always be what you want, and you cannot change it. So, if you want to specify a different character decoding scheme , try to avoid this class. InputStreamReader is the better option, since FileReader extends InputStreamReader, FileReader uses character encoding provided to this class, or else use default character encoding of platform. Remember, InputStreamReader caches the character encoding and setting character encoding after creating object will not have any affect.

Example (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.