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

Deserialize() public method

De-serialize 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.InputHandleIndex = ropBytes[index++];
            this.ReturnValue = (uint)BitConverter.ToInt32(ropBytes, index);
            index += 4;
            
            if (this.ReturnValue == 0)
            {
                this.AttachmentIdCount = (ushort)BitConverter.ToInt16(ropBytes, index);
                index += 2;

                if (this.AttachmentIdCount > 0)
                {
                    this.AttachmentIdArray = new uint[this.AttachmentIdCount];
                    for (int i = 0; i < this.AttachmentIdCount; i++)
                    {
                        this.AttachmentIdArray[i] = (uint)BitConverter.ToInt32(ropBytes, index);
                        index += 4;
                    }
                }
            }

            return index - startIndex;
        }
    }
RopGetValidAttachmentsResponse