[][src]Function packs::ll::types::lengths::read_dict_size

pub fn read_dict_size<T: Read>(
    marker: Marker,
    reader: &mut T
) -> Result<usize, DecodeError>

Reads the size of a PackStream Dictionary as denoted by the marker. Reports UnexpectedMarker on markers which denote no Dictionary.

use packs::ll::marker::Marker;
use packs::ll::types::lengths::{read_dict_size, Length};

let mut buffer = Vec::with_capacity(2);
Length::Bit16(42042).encode(&mut buffer).unwrap();

let size = read_dict_size(Marker::Dictionary16, &mut buffer.as_slice()).unwrap();

assert_eq!(42042, size);