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

SetDictionary() public method

Set compression dictionary
public SetDictionary ( byte buffer, int offset, int length ) : void
buffer byte The buffer containing the dictionary data
offset int The offset in the buffer for the first byte of data
length int The length of the dictionary data.
return void
        public void SetDictionary(byte[] buffer, int offset, int length)
        {
            #if DebugDeflation
            if (DeflaterConstants.DEBUGGING && (strstart != 1) )
            {
                throw new InvalidOperationException("strstart not 1");
            }
            #endif
            adler.Update(buffer, offset, length);
            if (length < MIN_MATCH) {
                return;
            }

            if (length > MAX_DIST) {
                offset += length - MAX_DIST;
                length = MAX_DIST;
            }

            System.Array.Copy(buffer, offset, window, strstart, length);

            UpdateHash();
            --length;
            while (--length > 0) {
                InsertString();
                strstart++;
            }
            strstart += 2;
            blockStart = strstart;
        }