[][src]Function streamvbyte::decode

pub fn decode(input: &[u8], output: &mut [u32]) -> usize

Decode a sequence of u32 integers from a vbyte encoded byte representation into an existing buffer output.

Arguments

  • input - The input sequence of vbyte encoding (u8s)
  • output - The output buf to store the recovered u32 integers. MUST be the same size as the original input sequence

Examples

use streamvbyte::{max_compressedbytes,encode,decode};
let input = vec![1,2,44,5123,43,534];
let out_buf = encode(&input);
let mut recovered = vec![0;6];
let bytes_read = decode(&out_buf,&mut recovered);
assert_eq!(bytes_read,out_buf.len());

Return

Returns the number of bytes processed from input during decoding