Package owl.util

Class GuardedStream


  • public final class GuardedStream
    extends Object
    Wrappers for streams which only forward a OutputStream.flush() upon OutputStream.close(). This is useful in combination with, e.g., System.out, since upon calling close on that stream, nothing can be written to console anymore.

    Warning: Code using these writers should still use try-with-resource guards or similar, as otherwise the output may not get flushed.