使用方法
IOUtils.closeStream(writer);
进入代码
public static void closeStream(java.io.Closeable stream) { cleanup(null, stream); } public static void cleanup(Log log, java.io.Closeable... closeables) { for (java.io.Closeable c : closeables) { if (c != null) { try { c.close(); } catch(IOException e) { if (log != null && log.isDebugEnabled()) { log.debug("Exception in closing " + c, e); } } } } }
时间: 2024-10-11 07:00:34