natix.CompactDS.BlockCoding.Encode C# (CSharp) Method

Encode() public method

public Encode ( BitStream32 Buffer, int u ) : void
Buffer BitStream32
u int
return void
        public void Encode(BitStream32 Buffer, int u)
        {
            if (u < 0) {
                throw new ArgumentOutOfRangeException (String.Format ("Invalid range for BlockCoding, u: {0}", u));
            }
            int skip = u >> this.Power;
            this.SkipCoder.Encode (Buffer, skip);
            u &= (1 << this.Power) - 1;
            Buffer.Write(u, this.Power);
        }