Class ScanResultInputStream

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

    class ScanResultInputStream
    extends java.io.FilterInputStream
    A wrapper around an InputStream originating from a ScanResult to ensure that it is closed when the stream is closed
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private io.github.classgraph.ScanResult result  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      ScanResultInputStream​(io.github.classgraph.ScanResult result, java.io.InputStream in)
      Creates a wrapper around an InputStream that was creating from a Class Graph ScanResult.
    • 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
    • Field Detail

      • result

        private final io.github.classgraph.ScanResult result
    • Constructor Detail

      • ScanResultInputStream

        ScanResultInputStream​(io.github.classgraph.ScanResult result,
                              java.io.InputStream in)
        Creates a wrapper around an InputStream that was creating from a Class Graph ScanResult. This ensures that when the stream is closed we also close the ScanResult from which it originated thus avoiding any resource leaks per ScanResult.close().
        Parameters:
        result - Scan Result that originated the input stream
        in - Input 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