java.io.FileReader翻译

来源:互联网 发布:淘宝号要实名认证 编辑:程序博客网 时间:2024/04/29 09:34
 Overview Package  Class Use Tree Deprecated Index Help JavaTM 2 Platform
Std. Ed. v1.4.2
 PREV CLASS   NEXT CLASSFRAMES    NO FRAMES     All Classes SUMMARY: NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD

java.io
Class FileReader

java.lang.Object  extended byjava.io.Reader      extended byjava.io.InputStreamReader          extended byjava.io.FileReader

public class FileReader
extends InputStreamReader

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.Readerlock  Constructor SummaryFileReader(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.InputStreamReaderclose, getEncoding, read, read, ready  Methods inherited from class java.io.Readermark, markSupported, read, reset, skip  Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 

Constructor Detail

FileReader

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 JavaTM 2 Platform
Std. Ed. v1.4.2
 PREV CLASS   NEXT CLASSFRAMES    NO FRAMES     All Classes SUMMARY: NESTED | FIELD | CONSTR | METHODDETAIL: 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.

原创粉丝点击