Skip to content

Most visited

Recently visited

navigation
Added in API level 1

FileReader

public class FileReader
extends InputStreamReader

java.lang.Object
   ↳ java.io.Reader
     ↳ java.io.InputStreamReader
       ↳ java.io.FileReader


A specialized Reader that reads from a file in the file system. All read requests made by calling methods in this class are directly forwarded to the equivalent function of the underlying operating system. Since this may induce some performance penalty, in particular if many small read requests are made, a FileReader is often wrapped by a BufferedReader.

See also:

Summary

Inherited fields

From class java.io.Reader

Public constructors

FileReader(File file)

Constructs a new FileReader on the given file.

FileReader(FileDescriptor fd)

Construct a new FileReader on the given FileDescriptor fd.

FileReader(String filename)

Construct a new FileReader on the given file named filename.

Inherited methods

From class java.io.InputStreamReader
From class java.io.Reader
From class java.lang.Object
From interface java.lang.Readable
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public constructors

FileReader

Added in API level 1
FileReader (File file)

Constructs a new FileReader on the given file.

Parameters
file File: a File to be opened for reading characters from.
Throws
FileNotFoundException if file does not exist.

FileReader

Added in API level 1
FileReader (FileDescriptor fd)

Construct a new FileReader on the given FileDescriptor fd. Since a previously opened FileDescriptor is passed as an argument, no FileNotFoundException can be thrown.

Parameters
fd FileDescriptor: the previously opened file descriptor.

FileReader

Added in API level 1
FileReader (String filename)

Construct a new FileReader on the given file named filename.

Parameters
filename String: an absolute or relative path specifying the file to open.
Throws
FileNotFoundException if there is no file named filename.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.