code: @Override
      public void write(IChemObject object) throws CDKException {
          customizeJob();
          try {
              if (object instanceof IChemFile) {
                  writeChemFile((IChemFile) object);
                  return;
              } else if (object instanceof IChemModel) {
                  IChemFile file = object.getBuilder().newInstance(IChemFile.class);
                  IChemSequence sequence = object.getBuilder().newInstance(IChemSequence.class);
                  sequence.addChemModel((IChemModel) object);
                  file.addChemSequence(sequence);
                  writeChemFile((IChemFile) file);
                  return;
              } else if (object instanceof IAtomContainer) {
                  writeMolecule((IAtomContainer) object);
                  return;
              }
          } catch (Exception ex) {
              logger.error(ex.getMessage());
              logger.debug(ex);
              throw new CDKException("Exception while writing MDL file: " + ex.getMessage(), ex);
          }
          throw new CDKException("Only supported is writing of IChemFile, " + "IChemModel, and IAtomContainer objects.");
      }
docs: Writes a {@link IChemObject} to the MDL molfile formated output.
  It can only output ChemObjects of type {@link IChemFile},
  {@link IChemObject} and {@link IAtomContainer}.
  
  @param object {@link IChemObject} to write
  @see #accepts(Class)