If the Wire Type is set to 4-7, then the Length Indicator must be followed by the serialized data of the element.翻译
时间: 2024-04-23 10:25:46 浏览: 11
如果 Wire Type 设置为 4-7,则长度指示器后必须跟随元素的序列化数据。这句话的意思是,对于 Wire Type 为 4-7 的情况,数据的序列化格式必须遵守一定的规则,其中包括了长度指示器和元素数据的序列化方式。在序列化数据时,必须先写入长度指示器,然后再写入元素的序列化数据,以便在解析数据时能够正确地获取元素的长度信息和数据内容。因此,在使用 Wire Type 为 4-7 的情况下,必须确保序列化数据的格式符合规定,以便能够正确地解析数据。
相关问题
With Wire Type 4 it is necessary that the sizes of the Length Indicator for arrays and structures are identical so that the length field can be evaluated for an unknown Data ID.翻译
使用 Wire Type 4,对于数组和结构体的长度指示器,必须保证它们的大小相同,以便在出现未知的 Data ID 时可以正确地解析长度字段。这句话的意思是,当某个元素的数据类型是复杂数据类型(Wire Type 4)且其标记中的 Data ID 值未知时,需要通过长度指示器来获取该元素的实际数据长度。对于数组和结构体来说,它们的长度指示器都需要放在标记后面,并且必须保证它们的大小相同,才能够在处理未知 Data ID 的情况下正确地解析长度字段。否则,如果数组和结构体的长度指示器大小不同,就无法确定长度字段的大小,从而无法正确地解析元素的实际数据。因此,在使用 Wire Type 4 时,必须保证所有数组和结构体的长度指示器都具有相同的大小。
If the deserialization reads an unknown tag (i.e. a tag which is not defined in the known data definition), it must skip the unknown element using the information from the Wire Type and Length Indicator.翻译
如果反序列化读取到一个未知的标签(即在已知的数据定义中没有定义的标签),它必须使用 Wire Type 和 Length Indicator 中的信息跳过未知的元素。这句话的意思是,在反序列化数据时,如果遇到未知的标签,就必须跳过该标签对应的元素,并根据 Wire Type 和 Length Indicator 中的信息来确定需要跳过的字节数。在跳过未知元素后,反序列化过程可以继续进行,以便能够正确地解析后续的数据。这种机制可以确保在使用不同版本的数据定义时,仍然能够正确地解析数据,并且能够兼容未来的数据定义变化。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)