read_into_vec

Function read_into_vec 

Source
fn read_into_vec(
    reader: &mut impl Read,
    vec: &mut Vec<u8>,
    size: usize,
) -> Result<()>
Expand description

Using the provided vec as a buffer, read exactly [size] bytes of content from [reader] into it. Any existing content in vec will be discarded; however its capacity will be reused, making this function suitable for use in loops.