Expand description
Wire-level helpers for []<elem> and nullable []<elem> arrays.
Non-flexible arrays use a 4-byte big-endian INT32 length prefix (−1 for
null). Flexible (compact) arrays use an unsigned varint whose value is
len + 1 (0 means null).
Functions§
- array_
len_ prefix_ len - Number of bytes consumed by a non-nullable array-length prefix.
- get_
array_ len - Read a non-nullable array length. Returns an error if the encoded value is null (−1 / 0).
- get_
nullable_ array_ len - Read a nullable array length. Returns
Nonewhen the encoded value is null (−1 non-flex, 0 flex). - nullable_
array_ len_ prefix_ len - Number of bytes consumed by a nullable array-length prefix.
- put_
array_ len - Write a non-nullable array-length prefix.
- put_
nullable_ array_ len - Write a nullable array-length prefix.
Noneencodes as −1 (non-flex) or 0 (flex).