public void CopyToStream(Stream stream, Formatting formatting = Formatting.Indented) {
var sw = new JsonTextWriter(new StreamWriter(stream));
sw.Formatting = formatting;
sw.WriteStartArray();
foreach (var operation in Operations) {
operation.Write(sw);
}
sw.WriteEndArray();
sw.Flush();
}