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