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

Deflate() public method

Deflate drives actual compression of data
public Deflate ( bool flush, bool finish ) : bool
flush bool True to flush input buffers
finish bool Finish deflation with the current input.
return bool
        public bool Deflate(bool flush, bool finish)
        {
            bool progress;
            do {
                FillWindow();
                bool canFlush = flush && (inputOff == inputEnd);

            #if DebugDeflation
                if (DeflaterConstants.DEBUGGING) {
                    Console.WriteLine("window: [" + blockStart + "," + strstart + ","
                                + lookahead + "], " + compressionFunction + "," + canFlush);
                }
            #endif
                switch (compressionFunction) {
                    case DEFLATE_STORED:
                        progress = DeflateStored(canFlush, finish);
                        break;
                    case DEFLATE_FAST:
                        progress = DeflateFast(canFlush, finish);
                        break;
                    case DEFLATE_SLOW:
                        progress = DeflateSlow(canFlush, finish);
                        break;
                    default:
                        throw new InvalidOperationException("unknown compressionFunction");
                }
            } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made
            return progress;
        }