|
|||||||||||
| 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
FileInputStream provides the functionality to read from files.
| Constructor Summary | |
FileInputStream(File f)
Creates a new FileInputStream to read from the specified file. |
|
FileInputStream(String name)
Creates a new FileInputStream to read from the specified file. |
|
| Method Summary | |
int |
available()
Returns the number of bytes that can be read without blocking. |
void |
close()
Closes this stream and releases all system resources associated with it. |
int |
read()
Reads a single byte from this input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes from the stream into bytes, at offset ofs. |
int |
skip(int n)
Skips over and discards n bytes from the input stream. |
long |
skip(long n)
Skips over and discards n bytes from the input stream. |
| Methods inherited from class java.io.InputStream |
read |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, toString |
| Constructor Detail |
public FileInputStream(File f)
public FileInputStream(String name)
name - Name of the file to read.| Method Detail |
public int available()
throws IOException
available in class InputStreamIOException
public void close()
throws IOException
close in class InputStreamIOException
public int read()
throws IOException
read in class InputStreamIOException - if an I/O error occurs.
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamlen - Length of data to be read.b - Array to be filled with data read.off - Offset into b where to start writing the read data.
IOException - if an I/O error occurs.
IndexOutOfBoundsException - if ofs is negative, of len is neagitve, or
ofs+len exceeds the array.
public long skip(long n)
throws IOException
skip in class InputStreamn - Number of bytes to overread.
IOException - if an I/O error occurs.
public int skip(int n)
throws IOException
n - Number of bytes to overread.
IOException - if an I/O error occurs.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||