Package net.dona.doip.client

# 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.

- ## Field Summary

  ### Fields inherited from class java.io.FilterInputStream

  `in`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `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.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`

  ### 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, skipNBytes, transferTo`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `FilterInputStream`
    Throws:
      `IOException`