use std::io::{Cursor, Read}; use exact_reader::{File, MultiFile}; fn into_file(value: Cursor>) -> File>> { let len = value.get_ref().len(); File { file: value, size: len, filename: "cursor".to_string(), } } fn main() { let a: Cursor> = Cursor::new(vec![1u8, 2, 3]); let b: Cursor> = Cursor::new(vec![4u8, 5, 6]); let mut file = MultiFile::new(vec![into_file(a), into_file(b)]); let mut buf = [0u8; 4]; file.read(&mut buf).unwrap(); assert_eq!(buf, [1, 2, 3, 4]) }