Class CloseShieldInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

Proxy stream that prevents the underlying input stream from being closed.

This class is typically used in cases where an input stream needs to be passed to a component that wants to explicitly close the stream even if more input would still be available to other components.

  • Constructor Details

    • CloseShieldInputStream

      Using this constructor prevents IDEs from warning if the underlying input stream is never closed. Use wrap(InputStream) instead.
      Constructs a proxy that shields the given input stream from being closed.
      inputStream - underlying input stream
  • Method Details