Module java.base
Package java.io

Class FileReader

    • Constructor Detail

      • FileReader

        public FileReader​(String fileName)           throwsFileNotFoundException
        Creates a newFileReader, given the name of the file to read, using the platform'sdefault charset.
        Parameters:
        fileName - the name of the file to read
        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)           throwsFileNotFoundException
        Creates a newFileReader, given theFile to read, using the platform'sdefault charset.
        Parameters:
        file - theFile to read
        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 newFileReader, given theFileDescriptor to read, using the platform'sdefault charset.
        Parameters:
        fd - theFileDescriptor to read
      • FileReader

        public FileReader​(String fileName,Charset charset)           throwsIOException
        Creates a newFileReader, given the name of the file to read and thecharset.
        Parameters:
        fileName - the name of the file to read
        charset - thecharset
        Throws:
        IOException - 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.
        Since:
        11
      • FileReader

        public FileReader​(File file,Charset charset)           throwsIOException
        Creates a newFileReader, given theFile to read and thecharset.
        Parameters:
        file - theFile to read
        charset - thecharset
        Throws:
        IOException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
        Since:
        11