Package org.eclipse.rdf4j.common.io
Class UncloseableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.eclipse.rdf4j.common.io.UncloseableInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class UncloseableInputStream extends FilterInputStream
A wrapper for an input stream to avoid allowing libraries to close input streams unexpectedly using theclose()
method. Instead, they must be closed by the creator usingdoClose()
.- Author:
- Peter Ansell
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description UncloseableInputStream(InputStream parent)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
doClose()
Invoke close on FilterInputStream parent class.-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
UncloseableInputStream
public UncloseableInputStream(InputStream parent)
Constructor- Parameters:
parent
- input stream
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
doClose
public void doClose() throws IOException
Invoke close on FilterInputStream parent class.- Throws:
IOException
-
-