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 |
---|---|
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 java.io.Writer append(char c)
/dev/null
.append
in interface java.lang.Appendable
append
in class java.io.Writer
c
- The character to writepublic java.io.Writer append(java.lang.CharSequence csq, int start, int end)
/dev/null
.append
in interface java.lang.Appendable
append
in class java.io.Writer
csq
- 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 interface java.lang.Appendable
append
in class java.io.Writer
csq
- The character sequence to writepublic void write(int idx)
/dev/null
.write
in class java.io.Writer
idx
- The character to writepublic void write(char[] chr)
/dev/null
.write
in class java.io.Writer
chr
- The characters to writepublic void write(char[] chr, int st, int end)
/dev/null
.write
in class java.io.Writer
chr
- 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.Writer
str
- The string to writepublic void write(java.lang.String str, int st, int end)
/dev/null
.write
in class java.io.Writer
str
- The string to writest
- The start offsetend
- The number of characters to writepublic void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
Writer.flush()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
Writer.close()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"