我有这个 ArrayList 文件
for(File file : files){
InputStream in = FileInputStream(file);
// process each file and save it to file
OutputStream out = FileOutputStream(file);
try{
} finally {
in.close();
out.close();
}
}
性能真的很慢,因为每个循环都有一个输入/输出 close(),有没有更好的方法来做到这一点?我试图将输出流置于循环之外,但它不起作用。