docs: void serialize(IonDatagram dg)
          throws IonException
      {
          myIonSystem = dg.getSystem();
          mySymbolTable = null;
  
          // Write all top-level values in reverse
          writeIonValue(dg);
  
          // After all top-level values are written, write the local symbol table
          // that is attached to the top-level value that has just been written,
          // if it exists.
          if (mySymbolTable != null && mySymbolTable.isLocalTable()) {
              writeLocalSymbolTable(mySymbolTable);
          }
  
          // Write IVM
          writeBytes(BINARY_VERSION_MARKER_1_0);
      }