Most visited

Recently visited

Added in API level 1

FileReader

public class FileReader
extends InputStreamReader

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


阅读角色文件的便利课程。 该类的构造函数假定默认的字符编码和默认的字节缓冲区大小是合适的。 要自己指定这些值,请在FileInputStream上构建一个InputStreamReader。

FileReader是用于阅读字符流。 为了读取原始字节流,请考虑使用FileInputStream

也可以看看:

Summary

Inherited fields

From class java.io.Reader

Public constructors

FileReader(String fileName)

给定要读取的文件的名称,创建一个新的 FileReader

FileReader(File file)

创建一个新的 FileReader ,给定 File读取。

FileReader(FileDescriptor fd)

创建一个新的 FileReader ,给定 FileDescriptor读取。

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 (String fileName)

给定要读取的文件的名称,创建一个新的 FileReader

Parameters
fileName String: the name of the file to read from
Throws
FileNotFoundException if the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.

FileReader

Added in API level 1
FileReader (File file)

创建一个新的 FileReader ,给定 File读取。

Parameters
file File: the File to read from
Throws
FileNotFoundException if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.

FileReader

Added in API level 1
FileReader (FileDescriptor fd)

创建一个新的 FileReader ,给定 FileDescriptor读取。

Parameters
fd FileDescriptor: the FileDescriptor to read from

Hooray!