@Beta @GwtIncompatible public final class Flushables extends java.lang.Object
Flushable
objects.Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
logger |
Modifier | Constructor and Description |
---|---|
private |
Flushables() |
Modifier and Type | Method and Description |
---|---|
static void |
flush(java.io.Flushable flushable,
boolean swallowIOException)
Flush a
Flushable , with control over whether an IOException may be thrown. |
static void |
flushQuietly(java.io.Flushable flushable)
Equivalent to calling
flush(flushable, true) , but with no IOException in the
signature. |
public static void flush(java.io.Flushable flushable, boolean swallowIOException) throws java.io.IOException
Flushable
, with control over whether an IOException
may be thrown.
If swallowIOException
is true, then we don't rethrow IOException
, but merely
log it.
flushable
- the Flushable
object to be flushed.swallowIOException
- if true, don't propagate IO exceptions thrown by the flush
methodjava.io.IOException
- if swallowIOException
is false and Flushable.flush()
throws
an IOException
.Closeables.close(java.io.Closeable, boolean)
public static void flushQuietly(java.io.Flushable flushable)
flush(flushable, true)
, but with no IOException
in the
signature.flushable
- the Flushable
object to be flushed.