Attempt to remove the special `JpegStream.getBytes` method and utilize the regular `DecodeStream` one instead
Attempt to remove the special `JpegStream.getBytes` method and utilize the regular `DecodeStream` one instead

Note that no other image stream implements a special `getBytes` method, which makes `JpegStream` look somewhat odd.

I'm actually not sure what purpose this methods serves, since I successfully ran all tests locally with it commented out. Furhermore, I also ran tests with an added `if (length && length !== this.bufferLength) { throw new Error('length mismatch'); }` check, and didn't get a single test failure in that case either.

Looking at the history, it seems that this code originated back in PR 4528, but as far as I can tell there's no mention in either commit messages nor PR comments of why it was necessary to add a "special" `getBytes` function for the `JpegStream`.
My assumption is that there's a good reason why this method was added, e.g. to address a *specific* regression in one of the reference tests. However, I did check out commit https://github.com/mozilla/pdf.js/commit/58f697f977f4a60974d91b09b2da67133227837c locally and ran tests with this method commented out, and there didn't seem to be any image-related failures in that case either!?

Hence I'm suggesting that we attempt to simplify this code slightly be removing this special `getBytes` method. However, please note that there's perhaps a *small* risk of regressions in an edge-case where we currently have insufficient test-coverage.

Shoobx/pdf.js,nawawi/pdf.js,showpad/mozilla-pdf.js,xavier114fch/pdf.js,macroplant/pdf.js,timvandermeij/pdf.js,nawawi/pdf.js,adlerweb/pdf.js-Touch,caremerge/pdf.js,mukulmishra18/pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,showpad/mozilla-pdf.js,Rob--W/pdf.js,timvandermeij/pdf.js,macroplant/pdf.js,macroplant/pdf.js,Shoobx/pdf.js,nawawi/pdf.js,caremerge/pdf.js,mainegreen/pdf.js,xavier114fch/pdf.js,adlerweb/pdf.js-Touch,mainegreen/pdf.js,Snuffleupagus/pdf.js,mozilla/pdf.js,mukulmishra18/pdf.js,Rob--W/pdf.js,timvandermeij/pdf.js,mozilla/pdf.js,mozilla/pdf.js,Snuffleupagus/pdf.js,showpad/mozilla-pdf.js