Foundatio.Repositories.JsonPatch.PatchDocument.CopyToStream C# (CSharp) Method

CopyToStream() public method

public CopyToStream ( Stream stream, Formatting formatting = Formatting.Indented ) : void
stream System.IO.Stream
formatting Formatting
return void
        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();
        }