protected override int DoDeserializeFromByteArray(byte[] byteArray, int startIndex)
{
using (BitReader reader = new BitReader(byteArray, startIndex))
{
int headerType = reader.ReadInt32(2);
if (headerType != 0x3)
{
throw new InvalidOperationException(string.Format("Failed to get the StreamObjectHeaderEnd16bit header type value, expect value {0}, but actual value is {1}", 0x3, headerType));
}
uint typeValue = reader.ReadUInt32(14);
if (!Enum.IsDefined(typeof(StreamObjectTypeHeaderEnd), (int)typeValue))
{
throw new InvalidOperationException(string.Format("Failed to get the StreamObjectHeaderEnd16bit type value, the value {0} is not defined", typeValue));
}
this.Type = (StreamObjectTypeHeaderEnd)typeValue;
return 2;
}
}
}