pub fn read_bounded_len<R: Read + ?Sized>(
reader: &mut R,
max: usize,
) -> Result<usize, Error>Expand description
Reads a VarInt from the given reader and ensures it is less than or equal to max.
Returns an error if the VarInt is larger than max.