public final class UncloseableWriter
extends java.io.Writer
Writer.flush()
upon 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.
Modifier and Type | Field | Description |
---|---|---|
static java.io.Writer |
syserr |
|
static java.io.Writer |
sysout |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
flush() |
|
void |
write(char[] cbuf,
int off,
int len) |
|
void |
write(int b) |
public static final java.io.Writer syserr
public static final java.io.Writer sysout
public void close() throws java.io.IOException
close
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in class java.io.Writer
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException