How can a FileInputStream get the content of File?

Viewed 32104

I have a file f and I need to affect it into a FileInputStream fs :

File f = new File("C:/dir/foo.txt");
FileInputStream fs = (FileInputStream)f;

But i get this error :

Cannot cast from File to FileInputStream

How can fs get the content of f?

3 Answers
Related