code: public static File writeObjectToFile(Object o, String filename)
    throws IOException {
      return writeObjectToFile(o, new File(filename));
    }
docs: Write object to a file with the specified name.
  
  @param o
  object to be written to file
  @param filename
  name of the temp file
  @throws IOException
  If can't write file.
  @return File containing the object