Convenience class for reading character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are appropriate. To specify these values yourself, construct an
InputStreamReader on a FileInputStream .FileReader is meant for reading streams of characters. For reading streams of raw bytes, consider using a Java FileInputStream.
FileReader Constructors:
Once you have FileReader object in hand then there is a list of helper methods which can be used manipulate the files.FileReader Methods:
Example Program: import java.io.File; Output: This Description: A text file Output.txt is taken and created. Input is taken into the FileWriter and is written onto the file. The file is read using FileReader and printed.
Things to try:
|