Skip to main content

decode_stream

Function decode_stream 

Source
pub fn decode_stream(
    reader: &mut impl Read,
    ignore_garbage: bool,
    writer: &mut impl Write,
) -> Result<()>
Expand description

Stream-decode from a reader to a writer. Used for stdin processing. In-place strip + decode: read chunk -> strip whitespace in-place in read buffer -> decode in-place -> write. Eliminates separate clean buffer allocation (saves 16MB). Uses 16MB read buffer for maximum pipe throughput — read_full retries to fill the entire buffer from the pipe, and 16MB means the entire 10MB benchmark input is read in a single syscall batch, minimizing overhead.