public class FileReader extends InputStreamReader
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.Constructor and Description |
---|
FileReader(File file)
This method initializes a
FileReader instance to read from
the specified File object. |
FileReader(FileDescriptor fd)
This method initializes a
FileReader instance to read from
this specified FileDescriptor object. |
FileReader(String name)
This method initializes a
FileReader instance to read from
the specified named file. |
close, getEncoding, read, read, ready
public FileReader(File file) throws FileNotFoundException
FileReader
instance to read from
the specified File
object.file
- The File
object representing the file to read fromFileNotFoundException
- If the file is not found or some other
error occurspublic FileReader(FileDescriptor fd)
FileReader
instance to read from
this specified FileDescriptor
object.fd
- The FileDescriptor
to read from.public FileReader(String name) throws FileNotFoundException
FileReader
instance to read from
the specified named file.name
- The name of the file to read fromFileNotFoundException
- If the file is not found or some other
error occurs