jtulach@1334: /* jtulach@1334: * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. jtulach@1334: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jtulach@1334: * jtulach@1334: * This code is free software; you can redistribute it and/or modify it jtulach@1334: * under the terms of the GNU General Public License version 2 only, as jtulach@1334: * published by the Free Software Foundation. Oracle designates this jtulach@1334: * particular file as subject to the "Classpath" exception as provided jtulach@1334: * by Oracle in the LICENSE file that accompanied this code. jtulach@1334: * jtulach@1334: * This code is distributed in the hope that it will be useful, but WITHOUT jtulach@1334: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jtulach@1334: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jtulach@1334: * version 2 for more details (a copy is included in the LICENSE file that jtulach@1334: * accompanied this code). jtulach@1334: * jtulach@1334: * You should have received a copy of the GNU General Public License version jtulach@1334: * 2 along with this work; if not, write to the Free Software Foundation, jtulach@1334: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jtulach@1334: * jtulach@1334: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jtulach@1334: * or visit www.oracle.com if you need additional information or have any jtulach@1334: * questions. jtulach@1334: */ jtulach@1334: jtulach@1334: package java.io; jtulach@1334: jtulach@1334: jtulach@1334: /** jtulach@1334: * Convenience class for reading character files. The constructors of this jtulach@1334: * class assume that the default character encoding and the default byte-buffer jtulach@1334: * size are appropriate. To specify these values yourself, construct an jtulach@1334: * InputStreamReader on a FileInputStream. jtulach@1334: * jtulach@1334: *

FileReader is meant for reading streams of characters. jtulach@1334: * For reading streams of raw bytes, consider using a jtulach@1334: * FileInputStream. jtulach@1334: * jtulach@1334: * @see InputStreamReader jtulach@1334: * @see FileInputStream jtulach@1334: * jtulach@1334: * @author Mark Reinhold jtulach@1334: * @since JDK1.1 jtulach@1334: */ jtulach@1334: public class FileReader extends InputStreamReader { jtulach@1334: jtulach@1334: /** jtulach@1334: * Creates a new FileReader, given the name of the jtulach@1334: * file to read from. jtulach@1334: * jtulach@1334: * @param fileName the name of the file to read from jtulach@1334: * @exception FileNotFoundException if the named file does not exist, jtulach@1334: * is a directory rather than a regular file, jtulach@1334: * or for some other reason cannot be opened for jtulach@1334: * reading. jtulach@1334: */ jtulach@1334: public FileReader(String fileName) throws FileNotFoundException { jtulach@1334: super(new FileInputStream(fileName)); jtulach@1334: } jtulach@1334: jtulach@1334: /** jtulach@1334: * Creates a new FileReader, given the File jtulach@1334: * to read from. jtulach@1334: * jtulach@1334: * @param file the File to read from jtulach@1334: * @exception FileNotFoundException if the file does not exist, jtulach@1334: * is a directory rather than a regular file, jtulach@1334: * or for some other reason cannot be opened for jtulach@1334: * reading. jtulach@1334: */ jtulach@1334: public FileReader(File file) throws FileNotFoundException { jtulach@1334: super(new FileInputStream(file)); jtulach@1334: } jtulach@1334: jtulach@1334: /** jtulach@1334: * Creates a new FileReader, given the jtulach@1334: * FileDescriptor to read from. jtulach@1334: * jtulach@1334: * @param fd the FileDescriptor to read from jtulach@1334: */ jtulach@1334: public FileReader(FileDescriptor fd) { jtulach@1334: super(new FileInputStream(fd)); jtulach@1334: } jtulach@1334: jtulach@1334: }