CSharpUtils.BitWriter.WriteLSB C# (CSharp) Method

WriteLSB() public method

public WriteLSB ( int value, int length ) : void
value int
length int
return void
		public void WriteLSB(int value, int length)
        {
            Debug.Assert(value < 1 << length, "value does not fit in length");

            uint currentData = data | checked((uint)value << dataLength);
            int currentLength = dataLength + length;
            while (currentLength >= 8)
            {
                BaseStream.WriteByte((byte)currentData);
                currentData >>= 8;
                currentLength -= 8;
            }
            data = currentData;
            dataLength = currentLength;
        }