Class CloseShieldInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    class CloseShieldInputStream
    extends java.io.FilterInputStream
    Filter stream that prevents the underlying input stream from being closed.

    It's a simpler version than org.apache.commons.io.input.CloseShieldInputStream as it doesn't replace the underlying stream. It's only meant for internal use where we can close a ZipInputStream without closing the underlying stream itself.

    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      CloseShieldInputStream​(java.io.InputStream in)
      Creates a FilterInputStream by assigning the argument in to the field this.in so as to remember it for later use.
    • 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
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloseShieldInputStream

        public CloseShieldInputStream​(java.io.InputStream in)
        Creates a FilterInputStream by assigning the argument in to the field this.in so as to remember it for later use.
        Parameters:
        in - the underlying input stream, or null if this instance is to be created without an underlying stream.
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterInputStream
        Throws:
        java.io.IOException