Class Flushables
java.lang.Object
com.google.common.io.Flushables
Utility methods for working with
Flushable objects.- Since:
- 1.0
- Author:
- Michael Lancaster
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidFlush aFlushable, with control over whether anIOExceptionmay be thrown.static voidflushQuietly(Flushable flushable) Equivalent to callingflush(flushable, true), but with noIOExceptionin the signature.
-
Method Details
-
flush
Flush 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:
IOException- ifswallowIOExceptionis false andFlushable.flush()throws anIOException.- See Also:
-
flushQuietly
-