public int Deserialize(byte[] ropBytes, int startIndex)
{
int index = startIndex;
this.RopId = ropBytes[index++];
this.InputHandleIndex = ropBytes[index++];
this.ReturnValue = BitConverter.ToUInt32(ropBytes, index);
index += sizeof(uint);
// Only success response has below fields
if (this.ReturnValue == 0)
{
// Parse RowData
// Add RowData bytes into Context
Context.Instance.PropertyBytes = ropBytes;
Context.Instance.CurIndex = index;
// Allocate PropretyRowSetNode to parse RowData
this.RowData = new PropertyRow();
// Set row count
this.RowData.Parse(Context.Instance);
// Context.Instance.CurIndex indicates the already deserialized bytes' index
index = Context.Instance.CurIndex;
}
else
{
this.RowData = null;
}
return index - startIndex;
}
}