示例#1
0
        protected override Variant fixupImpl()
        {
            var elem = elements["ref"];

            byte[]           data = elem.Value.Value;
            CiscoCDPChecksum sum  = new CiscoCDPChecksum();

            sum.Update(data);
            return(new Variant(sum.Final()));
        }
示例#2
0
        protected override Variant fixupImpl()
        {
            var elem = elements["ref"];
            var data = elem.Value;

            System.Diagnostics.Debug.Assert((BitwiseStream.BlockCopySize % 2) == 0);
            var buf = new byte[BitwiseStream.BlockCopySize];
            var sum = new CiscoCDPChecksum();

            data.Seek(0, System.IO.SeekOrigin.Begin);

            int nread;

            while ((nread = data.Read(buf, 0, buf.Length)) != 0)
            {
                sum.Update(buf, 0, nread);
            }

            return(new Variant(sum.Final()));
        }