public CommandAMF3Message(RTMPMessage x)
: base(x)
{
using (var reader=new AMF0Reader(new MemoryStream(x.Body))) {
reader.BaseStream.ReadByte();
this.commandName = (string)reader.ReadValue();
this.transactionId = (int)reader.ReadValue();
this.commandObject = reader.ReadValue();
if (AMFValue.IsNull(CommandObject)) {
this.commandObject = null;
}
var args = new List<AMFValue>();
while (reader.BaseStream.Position<reader.BaseStream.Length) {
args.Add(reader.ReadValue());
}
this.arguments = args;
}
}