fn read_length_prefixed<R: Read>(reader: &mut R) -> Result<Vec<u8>>
A helper function to read a length-prefixed value from a reader