code: public static void serialize(Object object, String file) throws Exception {
          if (object instanceof Serializable) {
              try (FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out =
                      new ObjectOutputStream(fileOut)) {
                  out.writeObject(object);
              }
          } else {
              throw new Exception(object.getClass().getName() + " doesn't implements serializable interface");
          }
      }
docs: 序列化对象
  
  @param object 实现了 {@link Serializable} 接口的对象
  @param file 保存到指定文件
  
  @throws Exception 异常
  @since 1.0.8