SWFProcessing.SWFModeller.ABCDataTypeWriter.WriteUBits C# (CSharp) Method

WriteUBits() public method

public WriteUBits ( uint value, int numBits ) : void
value uint
numBits int
return void
        public void WriteUBits(uint value, int numBits)
        {
            /* This is not the fastest way to do this, but right now I just need
             * to write something that works, dammit. */

            while (numBits --> 0)
            {
                uint bit = value & 1;
                value >>= 1;
                bit <<= this.bitCount++;
                this.buffer |= bit;
                if (this.bitCount == 8)
                {
                    this.Align8();
                }
            }
        }