ewe.io
Class FileReader

java.lang.Object
  extended byewe.io.Reader
      extended byewe.io.TextReader
          extended byewe.io.InputStreamReader
              extended byewe.io.FileReader

public class FileReader
extends InputStreamReader

This class provides a convenient way to set up a Reader to read from a file. It opens the specified file for reading and creates the InputStreamReader to read from the resulting FileInputStream. This class can only be used to read from files using the default character encoding. Use InputStreamReader directly to use a non-default encoding.


Field Summary
 
Fields inherited from class ewe.io.TextReader
bufferSize, closed, codec, input, stream
 
Fields inherited from class ewe.io.Reader
lock
 
Constructor Summary
FileReader(File file)
          This method initializes a FileReader instance to read from the specified File object.
FileReader(String name)
          This method initializes a FileReader instance to read from the specified named file.
 
Methods inherited from class ewe.io.InputStreamReader
getEncoding, setCodec
 
Methods inherited from class ewe.io.TextReader
close, read, readAll, readAll, readDirect, readFully, readFully, readLine, readString, ready
 
Methods inherited from class ewe.io.Reader
getLock, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

FileReader

public FileReader(File file)
           throws FileNotFoundException
This method initializes a FileReader instance to read from the specified File object.

Parameters:
file - The File object representing the file to read from
Throws:
FileNotFoundException - If the file is not found or some other error occurs

FileReader

public FileReader(String name)
           throws FileNotFoundException
This method initializes a FileReader instance to read from the specified named file.

Parameters:
name - The name of the file to read from
Throws:
FileNotFoundException - If the file is not found or some other error occurs