[][src]Function sqlite_varint::read_varint_byte_length

pub fn read_varint_byte_length(bytes: &[u8]) -> usize

Read how long the varint would be in amount of bytes.

Example

use sqlite_varint::read_varint_byte_length;
// Small positive integer values take little place
assert_eq!(1, read_varint_byte_length(&vec![0b00000001]));

// Negative values will always take 9 bytes.
// Note that the vector is 10 bytes long.
assert_eq!(9, read_varint_byte_length(&vec![0xff; 10]));