加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090302095418/http://developer.android.com:80/reference/java/io/FileReader.html
public class

FileReader

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

Class Overview

FileReader is class for turning a file into a character Stream. Data read from the source is converted into characters. The encoding is assumed to 8859_1. The FileReader contains a buffer of bytes read from the source and converts these into characters as needed. The buffer size is 8K.

See Also

Summary

[Expand]
Inherited Fields
From class java.io.Reader
Public Constructors
FileReader(File file)
Construct a new FileReader on the given File 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.
[Expand]
Inherited Methods
From class java.io.InputStreamReader
From class java.io.Reader
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.Readable

Public Constructors

public FileReader (File file)

Construct a new FileReader on the given File file. If the file specified cannot be found, throw a FileNotFoundException.

Parameters
file a File to be opened for reading characters from.
Throws
FileNotFoundException if the file cannot be opened for reading.

public FileReader (FileDescriptor fd)

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

Parameters
fd the previously opened file descriptor.

public FileReader (String filename)

Construct a new FileReader on the given file named filename. If the filename specified cannot be found, throw a FileNotFoundException.

Parameters
filename an absolute or relative path specifying the file to open.
Throws
FileNotFoundException if the filename cannot be opened for reading.