Package org.cactoos.io
Class CloseShieldOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.cactoos.io.CloseShieldOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public final class CloseShieldOutputStream extends OutputStream
Decorator ofOutputStream
to prevent it to be closed.There is no thread-safety guarantee.
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description CloseShieldOutputStream(OutputStream origin)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(byte[] buf)
void
write(byte[] buf, int off, int len)
void
write(int data)
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
CloseShieldOutputStream
public CloseShieldOutputStream(OutputStream origin)
Ctor.- Parameters:
origin
- Origin
-
-
Method Detail
-
write
public void write(int data) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
-