|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FileInputStream
public class FileInputStream
Reads a stream of bytes from a file.
Constructor Summary | |
---|---|
FileInputStream(File f)
|
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
int |
read()
Reads the next byte of data from the input stream. |
void |
reset()
resets pointers so next read() is from the start of the file; |
Methods inherited from class java.io.InputStream |
---|
close, mark, markSupported, read, read, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileInputStream(File f) throws FileNotFoundException
FileNotFoundException
Method Detail |
---|
public int available() throws IOException
InputStream
The available
method for class InputStream
always returns 0
.
This method should be overridden by subclasses.
available
in class InputStream
IOException
- if an I/O error occurs.public int read() throws IOException
InputStream
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.
read
in class InputStream
-1
if the end of the
stream is reached.
IOException
- if an I/O error occurs.public void reset()
reset
in class InputStream
InputStream.mark(int)
,
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |