Package gov.usgs.util

Class StreamUtils.UnclosableInputStream

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

    public static class StreamUtils.UnclosableInputStream
    extends java.io.FilterInputStream
    An InputStream that ignores calls to close. Used for methods that automatically close a stream at EOF, even though it is undesirable for the stream to be closed, such as when using a ZipInputStream.
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      UnclosableInputStream​(java.io.InputStream in)
      Create a new UnclosableInputStream object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Does not close stream.
      • 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

      • UnclosableInputStream

        public UnclosableInputStream​(java.io.InputStream in)
        Create a new UnclosableInputStream object.
        Parameters:
        in - the InputStream to wrap.
    • Method Detail

      • close

        public void close()
        Does not close stream.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterInputStream