/** * Flushes and closes the given <code>{@link OutputStream}</code>. Any I/O errors catched by this method are ignored * and not rethrown. * * @param out the output stream to flush and close. */ public static void flushAndClose(OutputStream out) { if (out == null) { return; } flush(out); closeQuietly(out); }
/** * Flushes and closes the given <code>{@link Writer}</code>. Any I/O errors catched by this method are ignored and not * rethrown. * * @param writer the writer to flush and close. */ public static void flushAndClose(Writer writer) { if (writer == null) { return; } flush(writer); closeQuietly(writer); }