/** * Flushes the given <code>{@link Flushable}</code>s, ignoring any thrown exceptions. * * @param flushables the {@code Flushable}s to flush. */ public static void flush(Flushable... flushables) { for (Flushable f : flushables) { flushFlushable(f); } }
/** * 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); }