public class NullWriter extends java.io.Writer
Writer writes all data to the famous /dev/null.
This Writer has no destination (file/socket etc.) and all
characters written to it are ignored and lost.
| Modifier and Type | Field | Description |
|---|---|---|
static NullWriter |
NULL_WRITER |
A singleton.
|
| Constructor | Description |
|---|---|
NullWriter() |
Constructs a new NullWriter.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.io.Writer |
append(char c) |
Does nothing - output to
/dev/null. |
java.io.Writer |
append(java.lang.CharSequence csq) |
Does nothing - output to
/dev/null. |
java.io.Writer |
append(java.lang.CharSequence csq,
int start,
int end) |
Does nothing - output to
/dev/null. |
void |
close() |
|
void |
flush() |
|
void |
write(char[] chr) |
Does nothing - output to
/dev/null. |
void |
write(char[] chr,
int st,
int end) |
Does nothing - output to
/dev/null. |
void |
write(int idx) |
Does nothing - output to
/dev/null. |
void |
write(java.lang.String str) |
Does nothing - output to
/dev/null. |
void |
write(java.lang.String str,
int st,
int end) |
Does nothing - output to
/dev/null. |
public static final NullWriter NULL_WRITER
public NullWriter()
public java.io.Writer append(char c)
/dev/null.append in class java.io.Writerc - The character to writepublic java.io.Writer append(java.lang.CharSequence csq, int start, int end)
/dev/null.append in class java.io.Writercsq - The character sequence to writestart - The index of the first character to writeend - The index of the first character to write (exclusive)public java.io.Writer append(java.lang.CharSequence csq)
/dev/null.append in class java.io.Writercsq - The character sequence to writepublic void write(int idx)
/dev/null.write in class java.io.Writeridx - The character to writepublic void write(char[] chr)
/dev/null.write in class java.io.Writerchr - The characters to writepublic void write(char[] chr, int st, int end)
/dev/null.write in class java.io.Writerchr - The characters to writest - The start offsetend - The number of characters to writepublic void write(java.lang.String str)
/dev/null.write in class java.io.Writerstr - The string to writepublic void write(java.lang.String str, int st, int end)
/dev/null.write in class java.io.Writerstr - The string to writest - The start offsetend - The number of characters to writepublic void flush()
flush in class java.io.WriterWriter.flush()public void close()
close in class java.io.WriterWriter.close()