private static byte[] CreateBody(string property_name, IEnumerable<AMFValue> arguments) { var s = new MemoryStream(); using (var writer=new AMF0Writer(s)) { writer.WriteString(property_name); foreach (var arg in arguments) { writer.WriteValue(arg); } } return s.ToArray(); }
private static byte[] CreateBody( string command_name, int transaction_id, AMFValue command_object, IEnumerable<AMFValue> arguments) { var s = new MemoryStream(); using (var writer=new AMF0Writer(s)) { writer.WriteString(command_name); writer.WriteNumber(transaction_id); writer.WriteValue(command_object); if (arguments!=null) { foreach (var arg in arguments) { writer.WriteValue(arg); } } } return s.ToArray(); }