Function streamExact [src]

"Pump" exactly n bytes from the reader to the writer.

Prototype

pub fn streamExact(r: *Reader, w: *Writer, n: usize) StreamError!void

Parameters

r: *Readerw: *Writern: usize

Possible Errors

EndOfStream

End of stream indicated from the Reader. This error cannot originate from the Writer.

ReadFailed

See the Reader implementation for detailed diagnostics.

WriteFailed

See the Writer implementation for detailed diagnostics.

Source

pub fn streamExact(r: *Reader, w: *Writer, n: usize) StreamError!void { var remaining = n; while (remaining != 0) remaining -= try r.stream(w, .limited(remaining)); }