[/url] [url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
java.io
Class FileReaderjava.lang.Object
java.io.Reader
java.io.InputStreamReader
java.io.FileReader
public class FileReader extends InputStreamReaderConvenience 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, FileInputStreamField Summary
Fields inherited from class java.io.Reader
Constructor Summary
FileReader(File file)
Creates a new FileReader, given the File to read from. 创建一个FileReader,给定要读取的File。
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
close, getEncoding, read, ,]read, ready
Methods inherited from class java.io.Reader
mark, markSupported, )]read, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
FileReaderpublic 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. 如果该名称的文件不存在,或者是目录而不是常规文件,或者其他原因不能打开,则抛出。FileReaderpublic 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. 如果该文件不存在,或者是目录而不是常规文件,或者其他原因不能打开,则抛出。FileReaderpublic FileReader(FileDescriptor fd)
Creates a new FileReader, given the FileDescriptor to read from. 创建一个FileReader,给定要读取的FileDescriptor。
Parameters: fd - the FileDescriptor to read from 要读取的FileDescriptor[/url][url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
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.