public class FileUtils {
public static void closeIO(Closeable...ios){
for (Closeable io : ios) {
if (io!=null) {
try {
io.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
FileUtils.closeIO(new Closeable[]{is,br,fos}); //关闭时调用的方法