public InputStream newInputStream (Path path, OpenOption… options) throws IOException

Opens a file, returning an input stream to read from the file. This method works in exactly the manner specified by the Files.newInputStream method.

The default implementation of this method opens a channel to the file as if by invoking the newByteChannel method and constructs a stream that reads bytes from the channel. This method should be overridden where appropriate.

Parameters:
path     the path to the file to open
options     options specifying how the file is opened

Returns:  a new input stream

Exceptions:
IllegalArgumentException     if an invalid combination of options is specified
UnsupportedOperationException     if an unsupported option is specified
IOException     if an I/O error occurs
SecurityException     In the case of the default provider, and a security manager is installed, the checkRead method is invoked to check read access to the file.