DthingApi
Public Member Functions | Protected Member Functions | List of all members
java.io.FileInputStream Class Reference
Inheritance diagram for java.io.FileInputStream:
java.io.InputStream

Public Member Functions

 FileInputStream (File file) throws FileNotFoundException
 
 FileInputStream (FileDescriptor fd)
 
 FileInputStream (String path) throws FileNotFoundException
 
int available () throws IOException
 
void close () throws IOException
 
final FileDescriptor getFD () throws IOException
 
int read () throws IOException
 
int read (byte[] buffer) throws IOException
 
int read (byte[] buffer, int byteOffset, int byteCount) throws IOException
 
long skip (long byteCount) throws IOException
 
- Public Member Functions inherited from java.io.InputStream
 InputStream ()
 
int available () throws IOException
 
void close () throws IOException
 
void mark (int readlimit)
 
boolean markSupported ()
 
abstract int read () throws IOException
 
int read (byte[] buffer) throws IOException
 
int read (byte[] buffer, int offset, int length) throws IOException
 
synchronized void reset () throws IOException
 
long skip (long byteCount) throws IOException
 

Protected Member Functions

void finalize () throws IOException
 

Detailed Description

An input stream that reads bytes from a file.

File file = ...
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
...
} finally {
if (in != null) {
in.close();
}
}

This stream is not buffered. Most callers should wrap this stream with a BufferedInputStream.

Use FileReader to read characters, as opposed to bytes, from a file.

See also
BufferedInputStream
FileOutputStream

Constructor & Destructor Documentation

◆ FileInputStream() [1/3]

java.io.FileInputStream.FileInputStream ( File  file) throws FileNotFoundException
inline

Constructs a new

that reads from

file

.

Parameters
filethe file from which this stream reads.
Exceptions
FileNotFoundExceptionif
file
does not exist.

◆ FileInputStream() [2/3]

java.io.FileInputStream.FileInputStream ( FileDescriptor  fd)
inline

Constructs a new

that reads from

fd

.

Parameters
fdthe FileDescriptor from which this stream reads.
Exceptions
NullPointerExceptionif
fd
is
null
.

◆ FileInputStream() [3/3]

java.io.FileInputStream.FileInputStream ( String  path) throws FileNotFoundException
inline

Equivalent to

new FileInputStream(new File(path))

.

Member Function Documentation

◆ finalize()

void java.io.FileInputStream.finalize ( ) throws IOException
inlineprotected

Ensures that all resources for this stream are released when it is about to be garbage collected.

Exceptions
IOExceptionif an error occurs attempting to finalize this stream.

◆ getFD()

final FileDescriptor java.io.FileInputStream.getFD ( ) throws IOException
inline

Returns the underlying file descriptor.


The documentation for this class was generated from the following file: