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.HasFinished = ropBytes[index++];
this.DataSize = (ushort)BitConverter.ToInt16(ropBytes, index);
index += sizeof(ushort);
if (this.DataSize > 0)
{
this.Data = new byte[this.DataSize];
Array.Copy(ropBytes, index, this.Data, 0, this.DataSize);
index += this.DataSize;
}
}
return index - startIndex;
}
}