Package net.dona.doip.client
Class DelegatedCloseableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- net.dona.doip.client.DelegatedCloseableInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class DelegatedCloseableInputStream extends java.io.FilterInputStream
An input stream which will run a supplied runnable when the input stream is closed.
-
-
Constructor Summary
Constructors Constructor Description DelegatedCloseableInputStream(java.io.InputStream in, java.lang.Runnable closeFunction)
Constructs an input stream which wraps the supplied input stream and runs the supplied runnable when the input stream is closed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
-
-
-
Constructor Detail
-
DelegatedCloseableInputStream
public DelegatedCloseableInputStream(java.io.InputStream in, java.lang.Runnable closeFunction)
Constructs an input stream which wraps the supplied input stream and runs the supplied runnable when the input stream is closed.- Parameters:
in
- the input stream to wrapcloseFunction
- the runnable to run when the input stream is closed
-
-