我有一个
文件f,我需要将它影响到FileInputStream fs:
File f = new File("C:/dir/foo.txt");
FileInputStream fs = (FileInputStream)f;
但我得到这个错误:
Cannot cast from File to FileInputStream
fs如何获得f的内容?
诀窍是:
FileInputStream fs = new FileInputStream(f);
原文链接:https://www.f2er.com/java/127983.html