Function tikv_util::codec::bytes::encoded_compact_len[][src]

pub fn encoded_compact_len(encoded: &[u8]) -> usize

Gets the first encoded bytes’ length in compactly encoded data.

Compact-encoding includes a VarInt encoded length prefix (1 ~ 9 bytes) and N bytes payload. This function gets the total bytes length of compact-encoded data, including the length prefix.

Note: - This function won’t check whether the bytes are encoded correctly. - There can be multiple compact-encoded data, placed one by one. This function only returns the length of the first one.