Microsoft.Protocols.TestSuites.Common.RopFastTransferSourceGetBufferResponse.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);
                                                                                                                                                                             
            // 4 indicates UInt32 bit occupies 4 bytes location
            index += 4;
            this.TransferStatus = (ushort)BitConverter.ToInt16(ropBytes, index);
                                                                                                                                                                             
            // 2 indicates UInt16 bit occupies 2 bytes location
            index += 2;
            this.InProgressCount = (ushort)BitConverter.ToInt16(ropBytes, index);
                                                                                                                                                                             
            // 2 indicates UInt16 bit occupies 2 bytes location
            index += 2;
            this.TotalStepCount = (ushort)BitConverter.ToInt16(ropBytes, index);
                                                                                                                                                                             
            // 2 indicates UInt16 bit occupies 2 bytes location
            index += 2;
            this.Reserved = ropBytes[index++];
            this.TransferBufferSize = (ushort)BitConverter.ToInt16(ropBytes, index);
                                                                                                                                                                             
            // 2 indicates UInt16 bit occupies 2 bytes location
            index += 2;

            this.TransferBuffer = new byte[this.TransferBufferSize];
                                                                                                                                                                             
            // 0 indicates start index
            Array.Copy(ropBytes, index, this.TransferBuffer, 0, this.TransferBufferSize);
            index += this.TransferBufferSize;
                                                                                                                                                                             
            // The field BackOffTime is present if the ReturnValue is 0x480
            if (this.ReturnValue == 0x00000480) 
            {
                this.BackoffTime = (uint)BitConverter.ToInt32(ropBytes, index);
                                                                                                                                                                             
                // 4 indicates UInt32 bit occupies 4 bytes location
                index += 4;
            }
                                                                                                                                                                                                
            return index - startIndex;
        }
    }
RopFastTransferSourceGetBufferResponse