public void Save(Stream stream, RipDocument document) { var writer = new RipWriter(stream); foreach (var command in document.Commands) { command.Write(writer); } writer.WriteNewCommand("#|#|#"); writer.WriteNewLine(); }
public static void Write(this NetOutgoingMessage message, IEnumerable <RipCommand> commands) { var stream = new MemoryStream(); var writer = new RipWriter(stream); foreach (var command in commands) { command.Write(writer); } stream.Flush(); stream.Position = 0; message.WriteStream((Stream)stream); }
public virtual void Write(RipWriter writer) { writer.WriteNewCommand(OpCode); }