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 and Description |
|---|---|
static NullWriter |
NULL_WRITER
A singleton.
|
| Constructor and Description |
|---|
NullWriter()
Constructs a new NullWriter.
|
| Modifier and Type | Method and Description |
|---|---|
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 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 interface java.io.Flushableflush in class java.io.WriterWriter.flush()public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.WriterWriter.close()Copyright (c) 2002-2014 Apache Software Foundation