code: public void writeMessageSetTo(final CodedOutputStream output)
                                  throws IOException {
      for (int i = 0; i < fields.getNumArrayEntries(); i++) {
        writeMessageSetTo(fields.getArrayEntryAt(i), output);
      }
      for (final Map.Entry<FieldDescriptorType, Object> entry :
               fields.getOverflowEntries()) {
        writeMessageSetTo(entry, output);
      }
    }
docs: Like {@link #writeTo} but uses MessageSet wire format.