Example usage for com.google.common.io Flushables flush

List of usage examples for com.google.common.io Flushables flush

Introduction

In this page you can find the example usage for com.google.common.io Flushables flush.

Prototype

public static void flush(Flushable flushable, boolean swallowIOException) throws IOException 

Source Link

Document

Flush a Flushable , with control over whether an IOException may be thrown.

Usage

From source file:com.puppycrawl.tools.checkstyle.PropertyCacheFile.java

/**
 * Flushes and closes output stream./*from w w  w.ja v  a 2 s. c om*/
 * @param stream the output stream
 * @throws IOException  when there is a problems with file flush and close
 */
private static void flushAndCloseOutStream(OutputStream stream) throws IOException {
    if (stream != null) {
        Flushables.flush(stream, false);
    }
    Closeables.close(stream, false);
}