code: public static <T> T withInputStream(URL url, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure<T> closure) throws IOException {
          return IOGroovyMethods.withStream(newInputStream(url), closure);
      }
docs: Creates a new InputStream for this URL and passes it into the closure.
  This method ensures the stream is closed after the closure returns.
  
  @param url     a URL
  @param closure a closure
  @return the value returned by the closure
  @throws IOException if an IOException occurs.
  @see IOGroovyMethods#withStream(java.io.InputStream, groovy.lang.Closure)
  @since 1.5.2