MCPcopy Index your code
hub / github.com/CoderLine/alphaTab / fillWindow

Method fillWindow

packages/alphatab/src/zip/DeflaterEngine.ts:471–503  ·  view source on GitHub ↗

* Fill the window

()

Source from the content-addressed store, hash-verified

469 * Fill the window
470 */
471 public fillWindow() {
472 /* If the window is almost full and there is insufficient lookahead,
473 * move the upper half to the lower one to make room in the upper half.
474 */
475 if (this._strstart >= DeflaterConstants.wsize + DeflaterConstants.maxDist) {
476 this._slideWindow();
477 }
478
479 /* If there is not enough lookahead, but still some input left,
480 * read in the input
481 */
482 if (this._lookahead < DeflaterConstants.minLookahead && this._inputOff < this._inputEnd) {
483 let more = 2 * DeflaterConstants.wsize - this._lookahead - this._strstart;
484
485 if (more > this._inputEnd - this._inputOff) {
486 more = this._inputEnd - this._inputOff;
487 }
488
489 this._window.set(
490 this._inputBuf!.subarray(this._inputOff, this._inputOff + more),
491 this._strstart + this._lookahead
492 );
493 this.inputCrc.update(this._inputBuf!, this._inputOff, more);
494
495 this._inputOff += more;
496 // this.totalIn += more;
497 this._lookahead += more;
498 }
499
500 if (this._lookahead >= DeflaterConstants.minMatch) {
501 this._updateHash();
502 }
503 }
504
505 private _slideWindow() {
506 this._window.set(

Callers 1

deflateMethod · 0.95

Calls 5

_slideWindowMethod · 0.95
_updateHashMethod · 0.95
updateMethod · 0.65
setMethod · 0.45
subarrayMethod · 0.45

Tested by

no test coverage detected