Microsoft.Protocols.TestSuites.Common.RopGetLocalReplicaIdsResponse.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)
            {
                // Guid includes 16 characters.
                this.ReplGuid = new byte[16];
                Array.Copy(ropBytes, index, this.ReplGuid, 0, 16);
                index += 16;
                                                                                                                                                                             
                // GlobalCount includes 6 bytes.
                this.GlobalCount = new byte[6];
                Array.Copy(ropBytes, index, this.GlobalCount, 0, 6);
                index += 6;
            }
                                                                                                                                                                                                
            return index - startIndex;
        }
    }
RopGetLocalReplicaIdsResponse