@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 |
printStream()
Retrieves a print stream using this null output stream.
|
static PrintStream |
wrapOrNullStream(OutputStream s)
Returns s wrapped into a
PrintStream if is not null,
printStream() 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 printStream()
public static PrintStream wrapOrNullStream(OutputStream s)
PrintStream if is not null,
printStream() otherwise.s - the OutputStream to wrap into a PrintStream. Can be null.printStream() otherwise.public void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreampublic void flush()
flush in interface Flushableflush in class OutputStreampublic void write(byte[] b)
write in class OutputStreamb - The byte array containing the data to be written.public void write(byte[] b, int off, int len)
write in class OutputStreamb - 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 OutputStreamb - The byte to be written.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.