Skip to main content

encode_stream

Function encode_stream 

Source
pub fn encode_stream(
    reader: &mut impl Read,
    wrap_col: usize,
    writer: &mut impl Write,
) -> Result<()>
Expand description

Stream-encode from a reader to a writer. Used for stdin processing. Uses 3MB read chunks (aligned to 3 bytes for padding-free intermediate encoding). 3MB is optimal for piped input: large enough for good throughput, small enough that read_full() fills the buffer quickly from pipes (3 reads at 1MB pipe size).