code: public static <T> T withObjectInputStream(InputStream inputStream, @ClosureParams(value=SimpleType.class, options="java.io.ObjectInputStream") Closure<T> closure) throws IOException {
          return withStream(newObjectInputStream(inputStream), closure);
      }
docs: Create a new ObjectInputStream for this file and pass it to the closure.
  This method ensures the stream is closed after the closure returns.
  
  @param inputStream an input stream
  @param closure     a closure
  @return the value returned by the closure
  @throws IOException if an IOException occurs.
  @see #withStream(java.io.InputStream, groovy.lang.Closure)
  @since 1.5.0