Hide
When closing or flushing a file, a stream, the same old actions are always done:
if (object != null) {
try {
object.close();
} catch {
// Ignored
}
}
Having a convenience method could simplify the code dealing with close and flush.
Proposed methods signatures:
FileUtils.close(Closeable... closeables);
FileUtils.close(Flusheable... flusheables);
WDYT ?
Show
When closing or flushing a file, a stream, the same old actions are always done:
if (object != null) {
try {
object.close();
} catch {
// Ignored
}
}
Having a convenience method could simplify the code dealing with close and flush.
Proposed methods signatures:
FileUtils.close(Closeable... closeables);
FileUtils.close(Flusheable... flusheables);
WDYT ?