Convenience class for reading character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are appropriate. To specify these values yourself, construct an InputStreamReader on a FileInputStream. 读取字符文件的工具类。该类的构造函数假定默认的字符编码和默认的字节缓冲大小是合适的。如果自己要指定这些值,应该基于FileInputStream构造一个InputStreamReader。
FileReader is meant for reading streams of characters. For reading streams of raw bytes, consider using a FileInputStream. FileReader是读取字符流的工具。如果读取字节流,应该考虑采用FileInputStream。
Since:
JDK1.1
See Also:
InputStreamReader, FileInputStream
Field Summary
Fields inherited from class java.io.Reader
lock
Constructor Summary
FileReader(File file) Creates a new FileReader, given the File to read from. 创建一个FileReader,给定要读取的File。
FileReader(FileDescriptor fd) Creates a new FileReader, given the FileDescriptor to read from. 创建一个FileReader,给定要读取的FileDescriptor。
FileReader(String fileName) Creates a new FileReader, given the name of the file to read from. 创建一个FileReader,给定要读取的文件名称。
Methods inherited from class java.io.InputStreamReader
public FileReader(String fileName)
throws FileNotFoundException
Creates a new FileReader, given the name of the file to read from. 创建一个FileReader,给定要读取的文件名称。
Parameters:
fileName - 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
public FileReader(File file)
throws FileNotFoundException
Creates a new FileReader, given the File to read from. 创建一个FileReader,给定要读取的File。
Parameters:
file - the File to read from 要读取的File
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
public FileReader(FileDescriptor fd)
Creates a new FileReader, given the FileDescriptor to read from. 创建一个FileReader,给定要读取的FileDescriptor。
Parameters:
fd - the FileDescriptor to read from 要读取的FileDescriptor
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASSNEXT CLASS
FRAMESNO FRAMESAll Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.