Make the `find` helper function, in `src/core/document.js`, more efficient by using `peekBytes` rather reading the stream one byte at a time
Make the `find` helper function, in `src/core/document.js`, more efficient by using `peekBytes` rather reading the stream one byte at a time

*Please note:* A a similar change was attempted in PR 5005, but it was subsequently backed out in PR 5069.

Unfortunately I don't think anyone ever tried to debug *exactly* why it didn't work, since it ought to have worked, and having re-tested this now I'm not able to reproduce the problem any more. However, given just how inefficient the current code is, with thousands of strictly unnecessary function calls for each `find` invocation, I'd really like to try fixing this again.

macroplant/pdf.js,mozilla/pdf.js,xavier114fch/pdf.js,macroplant/pdf.js,timvandermeij/pdf.js,macroplant/pdf.js,showpad/mozilla-pdf.js,showpad/mozilla-pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,caremerge/pdf.js,Snuffleupagus/pdf.js,nawawi/pdf.js,Shoobx/pdf.js,nawawi/pdf.js,timvandermeij/pdf.js,timvandermeij/pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,showpad/mozilla-pdf.js,nawawi/pdf.js,mainegreen/pdf.js,mainegreen/pdf.js,mozilla/pdf.js,xavier114fch/pdf.js,caremerge/pdf.js,mozilla/pdf.js