@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 and Description |
---|
NullOutputStream()
Creates a new null output stream instance.
|
Modifier and Type | Method and 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.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
public void write(@NotNull byte[] b)
write
in class java.io.OutputStream
b
- The byte array containing the data to be written.public void write(@NotNull byte[] b, int off, int len)
write
in class java.io.OutputStream
b
- 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.OutputStream
b
- The byte to be written.