twoway icon indicating copy to clipboard operation
twoway copied to clipboard

provide find_bytes for impl std::io::Read

Open afflux opened this issue 5 years ago • 2 comments

I recently needed to search for any occurrence of a sequence of bytes in a large file, so I built an iterator for matches in a file. Would you consider a PR for this?

afflux avatar Feb 08 '21 18:02 afflux

It's quite out of scope unfortunately. How would you bridge between different chunks?

bluss avatar Feb 08 '21 22:02 bluss

I advance the buffer for buffer.len() - pattern.len() + 1 whenever I hit the end using buffer.copy_within(). I just figured I'd ask if you'd want it in here before publishing my own microcrate.

afflux avatar Feb 09 '21 07:02 afflux