public class

FileInputStream

extends InputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ com.neomades.io.file.FileInputStream

Class Overview

A file input stream is an input stream for reading data from a File.

Summary

Public Constructors
FileInputStream(String path)
Creates a FileInputStream by opening a connection to an actual file, the file at the indicated path.
FileInputStream(File file)
Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.
Public Methods
int read()
Reads the next byte of data from the input stream.
[Expand]
Inherited Methods
From class java.io.InputStream
From class java.lang.Object

Public Constructors

public FileInputStream (String path)

Creates a FileInputStream by opening a connection to an actual file, the file at the indicated path.

Parameters
path the path of the file to open
Throws
IOException} if the file at the specified path cannot be opened
IOException

public FileInputStream (File file)

Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.

Parameters
file the file to be opened for reading
Throws
IOException} if the file cannot be opened
IOException

Public Methods

public int read ()

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

A subclass must provide an implementation of this method.

Returns
  • the next byte of data, or -1 if the end of the stream is reached.
Throws
IOException