Exemplo n.º 1
0
        void AddChecksum(OutputMessage message)
        {
            if (ChecksumEnabled)
            {
                uint checksum = Adler32(message.GetBuffer().ToArray(), (uint)message.GetBufferLength());

                int pos = message.Tell();
                message.Seek(0);
                message.AddU32(checksum);
                message.IncreaseHeaderLength(sizeof(uint));
                message.Seek(pos + sizeof(uint));
            }
        }