Package com.google.common.io
Class Flushables
- java.lang.Object
-
- com.google.common.io.Flushables
-
public final class Flushables extends java.lang.ObjectUtility methods for working withFlushableobjects.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Loggerlogger
-
Constructor Summary
Constructors Modifier Constructor Description privateFlushables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidflush(java.io.Flushable flushable, boolean swallowIOException)Flush aFlushable, with control over whether anIOExceptionmay be thrown.static voidflushQuietly(java.io.Flushable flushable)Equivalent to callingflush(flushable, true), but with noIOExceptionin the signature.
-
-
-
Method Detail
-
flush
public static void flush(java.io.Flushable flushable, boolean swallowIOException) throws java.io.IOExceptionFlush aFlushable, with control over whether anIOExceptionmay be thrown.If
swallowIOExceptionis true, then we don't rethrowIOException, but merely log it.- Parameters:
flushable- theFlushableobject to be flushed.swallowIOException- if true, don't propagate IO exceptions thrown by theflushmethod- Throws:
java.io.IOException- ifswallowIOExceptionis false andFlushable.flush()throws anIOException.- See Also:
Closeables.close(java.io.Closeable, boolean)
-
flushQuietly
public static void flushQuietly(java.io.Flushable flushable)
Equivalent to callingflush(flushable, true), but with noIOExceptionin the signature.- Parameters:
flushable- theFlushableobject to be flushed.
-
-