public virtual void ReadExternal(IDataInput input) { var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { int bits = 0; if (i == 0) { if ((flags[i] & BODY_FLAG) != 0) { Body = input.ReadObject(); } if ((flags[i] & CLIENT_ID_FLAG) != 0) { ClientId = input.ReadObject() as string; } if ((flags[i] & DESTINATION_FLAG) != 0) { Destination = input.ReadObject() as string; } if ((flags[i] & HEADERS_FLAG) != 0) { Headers = input.ReadObject(); } if ((flags[i] & MESSAGE_ID_FLAG) != 0) { MessageId = input.ReadObject() as string; } if ((flags[i] & TIMESTAMP_FLAG) != 0) { TimeStamp = Convert.ToInt64(input.ReadObject()); } if ((flags[i] & TIME_TO_LIVE_FLAG) != 0) { TimeToLive = Convert.ToInt64(input.ReadObject()); } bits = 7; } else if (i == 1) { if ((flags[i] & CLIENT_ID_BYTES_FLAG) != 0) { ClientIdBytes = input.ReadObject() as ByteArray; ClientId = RtmpUtil.FromByteArray(ClientIdBytes); } if ((flags[i] & MESSAGE_ID_BYTES_FLAG) != 0) { MessageIdBytes = input.ReadObject() as ByteArray; MessageId = RtmpUtil.FromByteArray(MessageIdBytes); } bits = 2; } ReadRemaining(input, flags[i], bits); } }
public override void ReadExternal(IDataInput input) { base.ReadExternal(input); var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { int bits = 0; if (i == 0) { if ((flags[i] & CORRELATION_ID_FLAG) != 0) { CorrelationId = input.ReadObject() as string; } if ((flags[i] & CORRELATION_ID_BYTES_FLAG) != 0) { CorrelationId = RtmpUtil.FromByteArray(input.ReadObject() as ByteArray); } bits = 2; } ReadRemaining(input, flags[i], bits); } }