Public class FileInputStream extends InputStream
Constructor | Description |
---|---|
FileInputStream (File file) | A file input stream is created by this constructor and connects to an actual file. |
FileInputStream(String name) | A file input stream object is created by this constructor and connects to an actual file based on the name provided by the path name in the file system. |
FileInputStream(FileDescriptor fdObj) | A file input stream object is created by this constructor and used the file descriptor to represent the connection of actual file. |
Method | Description |
---|---|
int available() | By using this method it returns the bytes and estimates that remaining bytes have to read from the input stream. |
void close() | By using this method the file input stream is closed and releases the another resources related to this stream. |
int read() | From the input stream this method can read bytes of data. |
int read(byte[] a) | By using this method it reads the data up to a.length bytes from the input stream. |
int read(byte[] b, int off, int n) | By using this method it reads the data up to 'n' bytes from the input stream into an array of bytes. |
protected void finalize() | By using this method it can close the input stream at that time close method is called only when there are no more actions to perform. |
FileChannel getChannel() | Associating with file input stream this method returns unique FileChannel object. |
FileDescriptor getFD() | In the file system the connection to actual file is represented by the FileDescriptor object which was return by this method being used by this FileInputStream. |
long skip(long n) | From the input stream this method skips over and throw out 'n' bytes of data. |