|
||||||||||
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
File input stream, can be constructed from a file descriptor or a file name.
FileOutputStream
,
File
Constructor Summary | |
FileInputStream(File file)
Creates an input file from the specified File object. |
|
FileInputStream(FileDescriptor fdObj)
|
|
FileInputStream(String name)
Creates an input file with the specified system dependent file name. |
Method Summary | |
int |
available()
Returns the number of bytes that can be read without blocking. |
void |
close()
Closes the input stream. |
protected void |
finalize()
Closes the stream when garbage is collected. |
FileDescriptor |
getFD()
Returns the opaque file descriptor object associated with this stream. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b)
Reads data into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Reads data into an array of bytes. |
long |
skip(long n)
Skips n bytes of input. |
Methods inherited from class java.io.InputStream |
mark, markSupported, reset |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileInputStream(String name) throws FileNotFoundException
name
- the system dependent file name
IOException
- If the file is not found.
FileNotFoundException
public FileInputStream(File file) throws FileNotFoundException
file
- the file to be opened for reading
IOException
- If the file is not found.
FileNotFoundException
public FileInputStream(FileDescriptor fdObj)
Method Detail |
public int read() throws IOException
read
in class InputStream
IOException
- If an I/O error has occurred.public int read(byte[] b) throws IOException
read
in class InputStream
b
- the buffer into which the data is read
IOException
- If an I/O error has occurred.public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
IOException
- If an I/O error has occurred.public long skip(long n) throws IOException
skip
in class InputStream
n
- the number of bytes to be skipped
IOException
- If an I/O error has occurred.public int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in class InputStream
IOException
- If an I/O error has occurred.public final FileDescriptor getFD() throws IOException
IOException
protected void finalize() throws IOException
finalize
in class Object
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |