Package org.eclipse.rdf4j.common.io
Class UncloseableOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.eclipse.rdf4j.common.io.UncloseableOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class UncloseableOutputStream extends FilterOutputStream
A wrapper for an output stream to avoid allowing libraries to close output streams unexpectedly using theclose()method. Instead, they must be closed by the creator usingdoClose().- Author:
- Bart Hanssens
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description UncloseableOutputStream(OutputStream parent)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddoClose()Invoke close on FilterOutputStream parent class.-
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
UncloseableOutputStream
public UncloseableOutputStream(OutputStream parent)
Constructor- Parameters:
parent- output stream
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
doClose
public void doClose() throws IOExceptionInvoke close on FilterOutputStream parent class.- Throws:
IOException
-
-