Package owl.util
Class GuardedStream
- java.lang.Object
-
- owl.util.GuardedStream
-
public final class GuardedStream extends Object
Wrappers for streams which only forward aOutputStream.flush()uponOutputStream.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.
-
-
Field Summary
Fields Modifier and Type Field Description static Writersyserrstatic OutputStreamsysout
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OutputStreamguard(OutputStream stream)static Writerguard(Writer writer)
-
-
-
Field Detail
-
syserr
public static final Writer syserr
-
sysout
public static final OutputStream sysout
-
-
Method Detail
-
guard
public static OutputStream guard(OutputStream stream)
-
-