Creates a FileInputStream by
opening a connection to an actual file,
the file named by the File
object file in the file system.
A new FileDescriptor object
is created to represent this file connection.
First, if there is a security manager,
its checkRead method is called
with the path represented by the file
argument as its argument.
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 then a
FileNotFoundException is thrown.
file | the file to be opened for reading. |
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. | |
SecurityException | if a security manager exists and its
checkRead method denies read access to the file. |
java.io.File.getPath(), java.lang.SecurityManager.checkRead(java.lang.String)
Diagram: InputStream