public class NullWriter
extends java.io.Writer
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 |
INSTANCE
The singleton instance.
|
static NullWriter |
NULL_WRITER
Deprecated.
Use
INSTANCE . |
Constructor and Description |
---|
NullWriter()
Deprecated.
Use
INSTANCE . |
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 INSTANCE
@Deprecated public static final NullWriter NULL_WRITER
INSTANCE
.@Deprecated public NullWriter()
INSTANCE
.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)
/dev/null
.append
in interface java.lang.Appendable
append
in class java.io.Writer
csq
- The character sequence 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 void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
Writer.close()
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
Writer.flush()
public 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(int idx)
/dev/null
.write
in class java.io.Writer
idx
- The character 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 writeCopyright © 2010 - 2023 Adobe. All Rights Reserved