@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class NullOutputStream extends OutputStream
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the output stream.
|
void |
flush()
Flushes the output stream.
|
static NullOutputStream |
instance()
Retrieves an instance of this null output stream.
|
static PrintStream |
nullPrintStream()
Retrieves a print stream using this null output stream.
|
static PrintStream |
wrapOrNullStream(OutputStream s)
Returns s wrapped into a
PrintStream if is not null,
nullPrintStream() otherwise. |
void |
write(byte[] b)
Writes the provided data to this output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes the provided data to this output stream.
|
void |
write(int b)
Writes the provided byte to this output stream.
|
public static NullOutputStream instance()
public static PrintStream nullPrintStream()
public static PrintStream wrapOrNullStream(OutputStream s)
PrintStream
if is not null,
nullPrintStream()
otherwise.s
- the OutputStream to wrap into a PrintStream
. Can be null.nullPrintStream()
otherwise.public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
public void flush()
flush
in interface Flushable
flush
in class OutputStream
public void write(byte[] b)
write
in class OutputStream
b
- The byte array containing the data to be written.public void write(byte[] b, int off, int len)
write
in class OutputStream
b
- The byte array containing the data to be written.off
- The offset at which the real data begins.len
- The number of bytes to be written.public void write(int b)
write
in class OutputStream
b
- The byte to be written.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.