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 void
close()
void
doClose()
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
doClose
public void doClose() throws IOException
Invoke close on FilterOutputStream parent class.- Throws:
IOException
-
-