The order of the codec fields on the protostuff-runtime server and the Android side is inconsistent

Solve the problem that the order of encoding/decoding fields is inconsistent between the protostuff-runtime server and the Android side. Because the parameter fieldMap of the fill method is implemented by LinkedHashMap, the order of the stored data will be saved. In order to make the field order of the server and Android side the same, you can change the fill method in the RuntimeSchema class, and use the sortable TreeMap to sort the Map according to the key. Finally, save the fieldMap to realize that the order of saving on the server side and the Android side is the same.

The compiled jar http://download.csdn .NET /detail/u013202238/9761641 jdk7 is compiled, if the compilation level is lower than 7 when the Android program is used, it is invalid

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327012526&siteId=291194637