Microsoft.Protocols.TestSuites.Common.RopGetReceiveFolderResponse.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.InputHandleIndex = ropBytes[index++];
            this.ReturnValue = (uint)BitConverter.ToInt32(ropBytes, index);
            index += sizeof(uint);

            // Only success response has below fields
            if (this.ReturnValue == 0)
            {
                this.FolderId = (ulong)BitConverter.ToInt64(ropBytes, index);
                index += sizeof(ulong);

                // If index equal length-1, can read the last element
                if (ropBytes.Length - index - 1 >= 0)
                {
                    this.MessageClass = new byte[ropBytes.Length - index];
                    Array.Copy(ropBytes, index, this.MessageClass, 0, ropBytes.Length - index);
                    index += ropBytes.Length - index;
                }
            }

            return index - startIndex;
        }
    }
RopGetReceiveFolderResponse