Ejemplo n.º 1
0
 private void _InitializeLazyMatch()
 {
     this.window_size = 2 * this.w_size;
     Array.Clear(this.head, 0, this.hash_size);
     this.config = DeflateManager.Config.Lookup(this.compressionLevel);
     this.SetDeflater();
     this.strstart        = 0;
     this.block_start     = 0;
     this.lookahead       = 0;
     this.match_length    = (this.prev_length = DeflateManager.MIN_MATCH - 1);
     this.match_available = 0;
     this.ins_h           = 0;
 }
Ejemplo n.º 2
0
        internal int SetParams(CompressionLevel level, CompressionStrategy strategy)
        {
            int result = 0;

            if (this.compressionLevel != level)
            {
                DeflateManager.Config config = DeflateManager.Config.Lookup(level);
                if (config.Flavor != this.config.Flavor && this._codec.TotalBytesIn != 0L)
                {
                    result = this._codec.Deflate(FlushType.Partial);
                }
                this.compressionLevel = level;
                this.config           = config;
                this.SetDeflater();
            }
            this.compressionStrategy = strategy;
            return(result);
        }