如何将FileInputStream转换为IntegratedStream?[已关闭]

2022-08-31 09:04:41

我只想将 a 转换为 a,我该怎么做?FileInputStreamInputStream

例如

FileInputStream fis = new FileInputStream("c://filename");
InputStream is = ?; 
fis.close();

答案 1
InputStream is;

try {
    is = new FileInputStream("c://filename");

    is.close(); 
} catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

return is;

答案 2
InputStream is = new FileInputStream("c://filename");
return is;

推荐