java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.aoapps.lang.io.NoCloseOutputStream
- All Implemented Interfaces:
NoClose
,Closeable
,Flushable
,AutoCloseable
Overrides
close()
to a no-op.-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Does not close the wrapped stream.static <O extends OutputStream & NoClose>
Owrap
(OutputStream out) Returnsout
when it is already aNoClose
andNoClose.isNoClose()
, otherwise returns a newNoCloseOutputStream
wrappingout
.void
write
(byte[] b, int off, int len) Methods inherited from class java.io.FilterOutputStream
flush, write, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
NoCloseOutputStream
Deprecated.Please usewrap(java.io.OutputStream)
to skip wrapping when possible.
-
-
Method Details
-
wrap
Returnsout
when it is already aNoClose
andNoClose.isNoClose()
, otherwise returns a newNoCloseOutputStream
wrappingout
. -
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
close
public void close()Does not close the wrapped stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceNoClose
- Overrides:
close
in classFilterOutputStream
-
wrap(java.io.OutputStream)
to skip wrapping when possible.