code: public static void eachObject(File self, Closure closure) throws IOException, ClassNotFoundException {
          IOGroovyMethods.eachObject(newObjectInputStream(self), closure);
      }
docs: Iterates through the given file object by object.
  
  @param self    a File
  @param closure a closure
  @throws IOException            if an IOException occurs.
  @throws ClassNotFoundException if the class  is not found.
  @see IOGroovyMethods#eachObject(java.io.ObjectInputStream, groovy.lang.Closure)
  @since 1.0