private static Module getModuleFromStream ( ModfileInputStream input ) { Iterator < Module > iter = getModulesArray ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Module mod = iter . next ( ) ; try { Module result = mod . loadModFile ( input ) ; input . seek ( 0 ) ; return result ; // <-- here this loading was a success! } catch ( Throwable ex ) { /* Ignoring */ } } return null ; }
Finds the appropriate loader through simply loading it!