Class DelegatedCloseableInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
net.dona.doip.client.DelegatedCloseableInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class DelegatedCloseableInputStream extends FilterInputStream
An input stream which will run a supplied runnable when the input stream is closed.
  • Constructor Details

    • DelegatedCloseableInputStream

      public DelegatedCloseableInputStream(InputStream in, 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 wrap
      closeFunction - the runnable to run when the input stream is closed
  • Method Details