Skip to content

EAimTY/slice-of-bytes-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slice-of-bytes-reader

Turns an iterator of AsRef<[u8]> into a reader implements std::io::Read.

Version Documentation License

Usage

let chunks: &[&[u8]] = &[
    b"", b"ab", b"", b"c", b"defg", b"", b"hij", b"klmnop", b"qrstuvw", b"", b"", b"xyz",
    b"", b"",
];

let mut reader = Reader::new(chunks.into_iter());
let mut result = String::new();
let total_length = reader.read_to_string(&mut result).unwrap();

assert_eq!(result, "abcdefghijklmnopqrstuvwxyz");
assert_eq!(total_length, 26);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages