[−][src]Function streamvbyte::decode_delta
pub fn decode_delta(input: &[u8], output: &mut [u32], initial: u32) -> usize
Decode a sequence of non decreasing 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 non decreasing u32 integers. MUST be the same size as the original input sequenceinitial
- The intial value thaw was substract from the all the value in the array during encoding.
Examples
use streamvbyte::{max_compressedbytes,encode_delta,decode_delta}; let input = vec![1,2,44,5123,43,534]; let out_buf = encode_delta(&input,1); let mut recovered = vec![0;6]; let bytes_read = decode_delta(&out_buf,&mut recovered,1); assert_eq!(bytes_read,out_buf.len());
Return
Returns the number of bytes processed from input during decoding