- java.lang.Object
-
- java.io.OutputStream
-
- com.aoapps.lang.io.NullOutputStream
-
- All Implemented Interfaces:
NoClose,Closeable,Flushable,AutoCloseable
public final class NullOutputStream extends OutputStream implements NoClose
Discards all data.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Calls to close are ignored whenNoClose.isNoClose(), otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.voidflush()static NullOutputStreamgetInstance()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Method Detail
-
getInstance
public static NullOutputStream getInstance()
-
close
public void close()
Description copied from interface:NoCloseCalls to close are ignored whenNoClose.isNoClose(), otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceNoClose- Overrides:
closein classOutputStream
-
flush
public void flush()
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
write
public void write(byte[] b)
- Overrides:
writein classOutputStream
-
write
public void write(byte[] b, int off, int len)- Overrides:
writein classOutputStream
-
write
public void write(int b)
- Specified by:
writein classOutputStream
-
-