1.关闭所有流
import java.io.Closeable; import java.io.IOException; public class AllClose { public static boolean close(Closeable ...closeables){ for(Closeable stream:closeables) { try { stream.close(); } catch (IOException e) { // TODO Auto-generated catch block System.out.println(e.getMessage()); return false; } } return true; } }
时间: 2024-10-06 16:40:26