public class NullWriter extends 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 |
---|---|
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 INSTANCE
@Deprecated public static final NullWriter NULL_WRITER
INSTANCE
.@Deprecated public NullWriter()
INSTANCE
.public Writer append(char c)
/dev/null
.append
in interface Appendable
append
in class Writer
c
- The character to writepublic Writer append(CharSequence csq)
/dev/null
.append
in interface Appendable
append
in class Writer
csq
- The character sequence to writepublic Writer append(CharSequence csq, int start, int end)
/dev/null
.append
in interface Appendable
append
in class 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 Closeable
close
in interface AutoCloseable
close
in class Writer
Writer.close()
public void flush()
flush
in interface Flushable
flush
in class Writer
Writer.flush()
public void write(char[] chr)
/dev/null
.public void write(char[] chr, int st, int end)
/dev/null
.public void write(int idx)
/dev/null
.Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.