fedimint_core::encoding

Function read_bytes_from_finite_reader

Source
fn read_bytes_from_finite_reader<D: Read + ?Sized>(
    d: &mut D,
    opts: ReadBytesFromFiniteReaderOpts,
) -> Result<Vec<u8>, Error>
Expand description

Read opts.len bytes from reader, where opts.len could potentially be malicious.

Adapted from https://github.com/rust-bitcoin/rust-bitcoin/blob/e2b9555070d9357fb552e56085fb6fb3f0274560/bitcoin/src/consensus/encode.rs#L659