コード例 #1
0
        internal int SetParams(CompressionLevel level, CompressionStrategy strategy)
        {
            int num = 0;

            if (this.compressionLevel != level)
            {
                Config config = Config.Lookup(level);
                if ((config.Flavor != this.config.Flavor) && (this._codec.TotalBytesIn != 0L))
                {
                    num = this._codec.Deflate(FlushType.Partial);
                }
                this.compressionLevel = level;
                this.config           = config;
                switch (this.config.Flavor)
                {
                case DeflateFlavor.Store:
                    this.DeflateFunction = new CompressFunc(this.DeflateNone);
                    break;

                case DeflateFlavor.Fast:
                    this.DeflateFunction = new CompressFunc(this.DeflateFast);
                    break;

                case DeflateFlavor.Slow:
                    this.DeflateFunction = new CompressFunc(this.DeflateSlow);
                    break;
                }
            }
            this.compressionStrategy = strategy;
            return(num);
        }
コード例 #2
0
        private void _InitializeLazyMatch()
        {
            this.window_size = 2 * this.w_size;
            for (int i = 0; i < this.hash_size; i++)
            {
                this.head[i] = 0;
            }
            this.config = Config.Lookup(this.compressionLevel);
            switch (this.config.Flavor)
            {
            case DeflateFlavor.Store:
                this.DeflateFunction = new CompressFunc(this.DeflateNone);
                break;

            case DeflateFlavor.Fast:
                this.DeflateFunction = new CompressFunc(this.DeflateFast);
                break;

            case DeflateFlavor.Slow:
                this.DeflateFunction = new CompressFunc(this.DeflateSlow);
                break;
            }
            this.strstart        = 0;
            this.block_start     = 0;
            this.lookahead       = 0;
            this.match_length    = this.prev_length = 2;
            this.match_available = 0;
            this.ins_h           = 0;
        }
コード例 #3
0
ファイル: DeflateManager.cs プロジェクト: KraigXu/GameProject
        private void SetDeflater()
        {
            switch (config.Flavor)
            {
            case DeflateFlavor.Store:
                DeflateFunction = DeflateNone;
                break;

            case DeflateFlavor.Fast:
                DeflateFunction = DeflateFast;
                break;

            case DeflateFlavor.Slow:
                DeflateFunction = DeflateSlow;
                break;
            }
        }
コード例 #4
0
        private void SetDeflater()
        {
            switch (this.config.Flavor)
            {
            case DeflateFlavor.Store:
                this.DeflateFunction = new CompressFunc(this.DeflateNone);
                break;

            case DeflateFlavor.Fast:
                this.DeflateFunction = new CompressFunc(this.DeflateFast);
                break;

            case DeflateFlavor.Slow:
                this.DeflateFunction = new CompressFunc(this.DeflateSlow);
                break;
            }
        }
コード例 #5
0
 private void SetDeflater()
 {
     switch (config.Flavor)
     {
         case DeflateFlavor.Store:
             DeflateFunction = DeflateNone;
             break;
         case DeflateFlavor.Fast:
             DeflateFunction = DeflateFast;
             break;
         case DeflateFlavor.Slow:
             DeflateFunction = DeflateSlow;
             break;
     }
 }