code: public void writeTo(final CodedOutputStream output)
                        throws IOException {
      for (int i = 0; i < fields.getNumArrayEntries(); i++) {
        final Map.Entry<FieldDescriptorType, Object> entry =
            fields.getArrayEntryAt(i);
        writeField(entry.getKey(), entry.getValue(), output);
      }
      for (final Map.Entry<FieldDescriptorType, Object> entry :
           fields.getOverflowEntries()) {
        writeField(entry.getKey(), entry.getValue(), output);
      }
    }
docs: See {@link Message#writeTo(CodedOutputStream)}.