/// <summary> /// Deserialize items from byte array. /// </summary> /// <param name="byteArray">The byte array which contains response message.</param> /// <param name="currentIndex">The index special where to start.</param> /// <param name="lengthOfItems">The length of items.</param> protected override void DeserializeItemsFromByteArray(byte[] byteArray, ref int currentIndex, int lengthOfItems) { if (lengthOfItems != 4) { throw new StreamObjectParseErrorException(currentIndex, "CellError", "Stream object over-parse error", null); } this.ErrorCode = (CellErrorCode)LittleEndianBitConverter.ToInt32(byteArray, currentIndex); if (!Enum.IsDefined(typeof(CellErrorCode), this.ErrorCode)) { throw new StreamObjectParseErrorException(currentIndex, "CellError", "Unexpected error code value " + this.ErrorCode, null); } currentIndex += 4; }
/// <summary> /// Parse the CellError structure. /// </summary> /// <param name="s">An stream containing CellError structure.</param> public override void Parse(Stream s) { base.Parse(s); this.ErrorCell = new bit32StreamObjectHeaderStart(); this.ErrorCell.Parse(s); this.ErrorCode = (CellErrorCode)ReadUint(); }