natix.CompactDS.DiffSetRL2.Commit C# (CSharp) Method

Commit() public method

public Commit ( natix.CompactDS.BitStreamCtxRL ctx ) : void
ctx natix.CompactDS.BitStreamCtxRL
return void
        void Commit(BitStreamCtxRL ctx)
        {
            // Console.WriteLine ("commit run_len: {0}", this.run_len);
            if (ctx.run_len > 0) {
                if (ctx.run_len == this.B) {
                    Coder.Encode (this.Stream, 1);
                } else {
                    Coder.Encode (this.Stream, 1);
                    Coder.Encode (this.Stream, ctx.run_len);
                }
                ctx.run_len = 0;
            }
        }