pub fn into_stream<R: BytesRead>(r: R, capacity: usize) -> IntoStream<R>
Expand description

Convert BytesRead into BytesStream.

Note

This conversion is not zero cost.

Example

use opendal::io_util::into_stream;

let r = io::Cursor::new(vec![0; 1024]);
let mut s = into_stream(r, 8 * 1024);
s.next().await;