public class NullOutputStream extends OutputStream
Modifier and Type | Field and Description |
---|---|
static NullOutputStream |
NULL_OUTPUT_STREAM
单例
|
Constructor and Description |
---|
NullOutputStream() |
Modifier and Type | Method and Description |
---|---|
void |
write(byte[] b)
什么也不做,写出到
/dev/null . |
void |
write(byte[] b,
int off,
int len)
什么也不做,写出到
/dev/null . |
void |
write(int b)
什么也不做,写出到
/dev/null . |
close, flush
public static final NullOutputStream NULL_OUTPUT_STREAM
public void write(byte[] b, int off, int len)
/dev/null
.write
in class OutputStream
b
- 写出的数据off
- 开始位置len
- 长度public void write(int b)
/dev/null
.write
in class OutputStream
b
- 写出的数据public void write(byte[] b) throws IOException
/dev/null
.write
in class OutputStream
b
- 写出的数据IOException
- 不抛出Copyright © 2021. All rights reserved.