[][src]Crate lebicon

Lebicon implements the codicon traits for LEB128 encoding / decoding.

Examples

extern crate codicon;
extern crate lebicon;

use codicon::{Decoder, Encoder};
use lebicon::Leb128;
use std::io::Write;

let encoded = [198, 253, 255, 127];
let decoded = 268435142u64;

let value = u64::decode(&mut &encoded[..], Leb128).unwrap();
assert_eq!(value, decoded);

let mut value: Vec<u8> = Vec::new();
decoded.encode(&mut value, Leb128).unwrap();
assert_eq!(&value[..], &encoded[..]);

Structs

Leb128

Enums

Error

The errors possibly returned when reading a LEB128-encoded integer.