Plupload.PngEncoder.DeflaterEngine.FillWindow C# (CSharp) Method

FillWindow() public method

Fill the window
public FillWindow ( ) : void
return void
        public void FillWindow()
        {
            /* If the window is almost full and there is insufficient lookahead,
             * move the upper half to the lower one to make room in the upper half.
             */
            if (strstart >= WSIZE + MAX_DIST) {
                SlideWindow();
            }

            /* If there is not enough lookahead, but still some input left,
             * read in the input
             */
            while (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) {
                int more = 2 * WSIZE - lookahead - strstart;

                if (more > inputEnd - inputOff) {
                    more = inputEnd - inputOff;
                }

                System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more);
                adler.Update(inputBuf, inputOff, more);

                inputOff += more;
                totalIn += more;
                lookahead += more;
            }

            if (lookahead >= MIN_MATCH) {
                UpdateHash();
            }
        }