Vector.<int>
, Vector.<uint>
, Vector.<Number>
and Vector.<Object>
. But I never managed to completely port the code - the server could not in any way deserialize the vector of objects (everything was in order with the numeric types). As a result, I had to put xdebug and start looking for myself “where the dog is buried”. As I suspected, the author of that article incorrectly implemented the parsing of a vector of objects and a little incorrect parsing of numerical vectors.S32 = An signed 32-bit integer in big endian (network) byte order vector-type = vector-int-type | vector-uint-type | vector-number-type | vector-object-type | vector-other-type value-type = | vector-type vector-int-marker = 0x0D vector-uint-marker = 0x0E vector-number-marker = 0x0F vector-object-marker = 0x10 U29V-len = U29; The first (low) bit is a flag with value 1. ; The remaining 1 to 28 significant bits are used to encode ; the length of the vector vector-fixed-flag = U8 vector-int-type = vector-int-marker (U29O-ref | U29V-length vector-fixed-flag * (S32)) vector-uint-type = vector-uint-marker (U29O-ref | U29V-length vector-fixed-flag * (U32)) vector-number-type = vector-number-marker (U29O-ref | U29V-length vector-fixed-flag * (DOUBLE)) vector-object-type = vec tor-object-marker (U29O-ref | U29V-length vector-fixed-flag class-name * (null-type | object-type)) vector-other-type = vector-object-marker (U29O-ref | U29V-length vector-fixed-flag UTF-8-empty * (null-type | false-type | true-type | array-type | string-type | vector-type | date-type | byte-array-type))
vector-other-type
rule. According to the specification it turns out that such a vector can simultaneously contain all of the listed types, but in fact only one of the listed types. And only null-type
can be used simultaneously with other types. Unfortunately, I do not know how to specify such a rule using ABNF.fixed
flag, and N values ( int
, uint
or double
). To be honest, I was surprised that these three vectors were rendered, especially against the background of the fact that the vectors of rows and boules are encoded as vectors of objects (more on this below).class-name
, the name of the class whose objects contain a vector. class-name
can be empty, meaning Object
.class-name
. So without data it is impossible to know what exactly the vector contains, i.e. it is impossible to know what kind of vector arrived if it is empty.Source: https://habr.com/ru/post/122178/
All Articles