摘要 |
A system and method for the efficient encoding and decoding of protocol messages is described. In one embodiment, an offset from a beginning of a memory buffer is calculated based upon a maximum size of a header portion of the message. A variable length portion of the message is encoded beginning at the offset, and the header portion of the message is encoded based upon an encoded size of the variable portion and a size of the header portion. The encoding of the header portion begins at the offset less the encoded size of the header portion. Further, a set of object identifiers are decoded into a data structure. If a value portion corresponding to an object identifier of the set of object identifiers is variable in length, the value portion is decoded into the data structure.
|