code: public static void writeObject(Object object, String fileName) throws DISIException {
          log.info("Writing " + fileName);
          try {
              FileOutputStream fos = new FileOutputStream(fileName);
              ObjectOutputStream oos = new ObjectOutputStream(fos);
              oos.writeObject(object);
              oos.close();
              fos.close();
          } catch (IOException e) {
              final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
              log.error(errMessage, e);
              throw new DISIException(errMessage, e);
          }
      }
docs: Writes Java object to a file.
  
  @param object   the object
  @param fileName the file where the object will be written
  @throws DISIException DISIException