Microsoft.Protocols.TestSuites.Common.RopBackoffResponse.Deserialize C# (CSharp) Method

Deserialize() public method

Deserialize the ROP response buffer.
public Deserialize ( byte ropBytes, int startIndex ) : int
ropBytes byte ROPs bytes in response.
startIndex int The start index of this ROP.
return int
        public int Deserialize(byte[] ropBytes, int startIndex)
        {
            int index = startIndex;
            this.RopId = ropBytes[index++];
            this.LogonId = ropBytes[index++];

            this.Duration = (uint)BitConverter.ToInt32(ropBytes, index);
            index += sizeof(uint);
            this.BackoffRopCount = ropBytes[index++];
            if (this.BackoffRopCount > 0)
            {
                this.BackoffRopData = new BackoffRop[this.BackoffRopCount];
                for (int i = 0; i < this.BackoffRopCount; i++)
                {
                    index += this.BackoffRopData[i].Deserialize(ropBytes, index);
                }
            }

            this.AdditionalDataSize = (ushort)BitConverter.ToInt16(ropBytes, index);
            index += sizeof(ushort);
            if (this.AdditionalDataSize > 0)
            {
                this.AdditionalData = new byte[this.AdditionalDataSize];
                Array.Copy(ropBytes, index, this.AdditionalData, 0, this.AdditionalDataSize);
                index += this.AdditionalDataSize;
            }

            return index - startIndex;
        }
    }
RopBackoffResponse