Skip to main content

read_bytes

Function read_bytes 

Source
pub fn read_bytes(r: &mut impl Read) -> Result<Vec<u8>, FormatError>
Expand description

Reads a length-prefixed byte vector: [len: u32][data].

Returns an error if the declared length exceeds MAX_FIELD_LEN to prevent unbounded allocations from corrupt data.