Skip to main content

read_varint_payload

Function read_varint_payload 

Source
fn read_varint_payload<const N: usize>(
    data: &mut &[u8],
    len: usize,
    negative: bool,
) -> [u8; N]
Expand description

Read a len byte payload and extend it to N bytes, with ones above it when negative.

len must not exceed N, since truncate keeps only the low N bytes and a wider payload would lose its top ones.