public class KeepAliveOutputStream extends FilterOutputStream
In code-language it means that it is not necessary to do:
if (out != System.out && out != System.err) { out.close(); }
out
Constructor and Description |
---|
KeepAliveOutputStream(OutputStream out)
Constructor of KeepAliveOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This method does nothing.
|
static PrintStream |
wrapSystemErr()
Convenience factory method that returns a non-closing
PrintStream around System.err.
|
static PrintStream |
wrapSystemOut()
Convenience factory method that returns a non-closing
PrintStream around System.out.
|
flush, write, write, write
public KeepAliveOutputStream(OutputStream out)
out
- an OutputStream value, it should be standard output.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
- as we are overriding FilterOutputStream.FilterOutputStream.flush()
,
FilterOutputStream.out
public static PrintStream wrapSystemErr()
public static PrintStream wrapSystemOut()