Module perlin::storage::compression [] [src]

This module currently provides utility methods and structs for variable byte codes as described in

Encode unsigned integers by using the vbyte_encode method.

Decode a bytestream by instatiating a VByteDecoder and using its iterator implementation.


use perlin::utils::compression::{vbyte_encode, VByteDecoder};

let bytes = vbyte_encode(3);
let three = VByteDecoder::new(bytes.into_iter()).next().unwrap();
assert_eq!(3, three);Run



Iterator that decodes a bytestream to unsigned integers


Stores the result of a vbyte encode operation without indirection that a Vec<u8> would introduce. Can thus be used to vbyte_encode on the stack