1. /*
  2. * @(#)FileReader.java 1.10 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.io;
  11. /**
  12. * Convenience class for reading character files. The constructors of this
  13. * class assume that the default character encoding and the default byte-buffer
  14. * size are appropriate. To specify these values yourself, construct an
  15. * InputStreamReader on a FileInputStream.
  16. *
  17. * @see InputStreamReader
  18. * @see FileInputStream
  19. *
  20. * @version 1.10, 00/02/02
  21. * @author Mark Reinhold
  22. * @since JDK1.1
  23. */
  24. public class FileReader extends InputStreamReader {
  25. /**
  26. * Creates a new <tt>FileReader</tt>, given the name of the
  27. * file to read from.
  28. *
  29. * @param fileName the name of the file to read from
  30. * @throws <tt>FileNotFoundException</tt> if the specified
  31. * file is not found
  32. */
  33. public FileReader(String fileName) throws FileNotFoundException {
  34. super(new FileInputStream(fileName));
  35. }
  36. /**
  37. * Creates a new <tt>FileReader</tt>, given the <tt>File</tt>
  38. * to read from.
  39. *
  40. * @param file the <tt>File</tt> to read from
  41. * @throws <tt>FileNotFoundException</tt> if the specified
  42. * file is not found
  43. */
  44. public FileReader(File file) throws FileNotFoundException {
  45. super(new FileInputStream(file));
  46. }
  47. /**
  48. * Creates a new <tt>FileReader</tt>, given the
  49. * <tt>FileDescriptor</tt> to read from.
  50. *
  51. * @param fd the FileDescriptor to read from
  52. */
  53. public FileReader(FileDescriptor fd) {
  54. super(new FileInputStream(fd));
  55. }
  56. }