public class NullWriter extends 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.
| 限定符和类型 | 字段和说明 |
|---|---|
static NullWriter |
NULL_WRITER
A singleton.
|
| 构造器和说明 |
|---|
NullWriter()
Constructs a new NullWriter.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Writer |
append(char c)
Does nothing - output to
/dev/null. |
Writer |
append(CharSequence csq)
Does nothing - output to
/dev/null. |
Writer |
append(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(String str)
Does nothing - output to
/dev/null. |
void |
write(String str,
int st,
int end)
Does nothing - output to
/dev/null. |
public static final NullWriter NULL_WRITER
public Writer append(char c)
/dev/null.append 在接口中 Appendableappend 在类中 Writerc - The character to writepublic Writer append(CharSequence csq, int start, int end)
/dev/null.append 在接口中 Appendableappend 在类中 Writercsq - The character sequence to writestart - The index of the first character to writeend - The index of the first character to write (exclusive)public Writer append(CharSequence csq)
/dev/null.append 在接口中 Appendableappend 在类中 Writercsq - The character sequence to writepublic void write(int idx)
/dev/null.public void write(char[] chr)
/dev/null.public void write(char[] chr,
int st,
int end)
/dev/null.public void write(String str)
/dev/null.public void write(String str, int st, int end)
/dev/null.public void flush()
flush 在接口中 Flushableflush 在类中 WriterWriter.flush()public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 WriterWriter.close()