@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class NullOutputStream extends java.io.OutputStream
java.io.OutputStream in
which any data written to it is simply discarded.| Constructor | Description |
|---|---|
NullOutputStream() |
Creates a new null output stream instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes this output stream.
|
void |
flush() |
Flushes the contents of this output stream.
|
static NullOutputStream |
getInstance() |
Retrieves an instance of this null output stream.
|
static java.io.PrintStream |
getPrintStream() |
Retrieves a print stream based on this null output stream.
|
void |
write(byte[] b) |
Writes the contents of the provided byte array over this output stream.
|
void |
write(byte[] b,
int off,
int len) |
Writes the contents of the provided byte array over this output stream.
|
void |
write(int b) |
Writes the provided byte over this input stream.
|
public NullOutputStream()
@NotNull public static NullOutputStream getInstance()
@NotNull public static java.io.PrintStream getPrintStream()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreampublic void flush()
flush in interface java.io.Flushableflush in class java.io.OutputStreampublic void write(@NotNull byte[] b)
write in class java.io.OutputStreamb - The byte array containing the data to be written.public void write(@NotNull byte[] b, int off, int len)
write in class java.io.OutputStreamb - The byte array containing the data to be written.off - The position in the array at which to start writing data.len - The number of bytes to be written.public void write(int b)
write in class java.io.OutputStreamb - The byte to be written.