Blaze.Server.TdfEncoder.WriteInteger C# (CSharp) Method

WriteInteger() private method

private WriteInteger ( ulong value ) : void
value ulong
return void
        private void WriteInteger(ulong value)
        {
            if (value < 0x40)
            {
                _stream.WriteByte((byte)(value & 0xFF));
            }
            else
            {
                _stream.WriteByte((byte)((value & 0x3F) | 0x80));
                ulong currshift = value >> 6;

                while (currshift >= 0x80)
                {
                    _stream.WriteByte((byte)((currshift & 0x7F) | 0x80));
                    currshift >>= 7;
                }

                _stream.WriteByte((byte)currshift);
            }
        }