code: private void writeCrystal(ICrystal crystal) {
  
          String sg = crystal.getSpaceGroup();
          if ("P 2_1 2_1 2_1".equals(sg)) {
              writeln("P 21 21 21 (1)");
          } else {
              writeln("P 1 (1)");
          }
  
          // output unit cell axes
          writeVector3d(crystal.getA());
          writeVector3d(crystal.getB());
          writeVector3d(crystal.getC());
  
          // output number of atoms
          int noatoms = crystal.getAtomCount();
          write(Integer.toString(noatoms));
          writeln("");
  
          // output number of asym. units (Z)
          if (sg.equals("P1")) {
              writeln("1");
          } else {
              // duno
              writeln("1");
          }
  
          // output atoms
          for (int i = 0; i < noatoms; i++) {
              // output atom sumbol
              IAtom atom = crystal.getAtom(i);
              write(atom.getSymbol());
              write(":");
              // output atom charge
              writeln(Double.toString(atom.getCharge()));
              // output coordinates
              writeln(Double.toString(atom.getPoint3d().x));
              writeln(Double.toString(atom.getPoint3d().y));
              writeln(Double.toString(atom.getPoint3d().z));
          }
  
      }
docs: Writes a single frame to the Writer.
  
  <p>Format:
  <pre>
  line      data
  -------    --------------------------
  1       spacegroup
  2,3,4     cell parameter: a
  5,6,7                     b
  8,9,10                    c
  11       number of atoms
  12       number of asym. units
  13-16     atomtype: charge, atomcoord x, y, z
  17-20     idem second atom
  21-24     idem third atom etc
  </pre>
  
  @param crystal the Crystal to serialize