From 865ec38696db43424c7490fabc91c120abdd2cac Mon Sep 17 00:00:00 2001 From: Marco Spatz Date: Wed, 19 Nov 2014 09:48:53 +0100 Subject: [PATCH] added missing Flush() that is called by Dispose() --- GenericStl/AsciiStlWriter.cs | 2 +- GenericStl/BinaryStlWriter.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GenericStl/AsciiStlWriter.cs b/GenericStl/AsciiStlWriter.cs index 8b93470..d126d73 100644 --- a/GenericStl/AsciiStlWriter.cs +++ b/GenericStl/AsciiStlWriter.cs @@ -47,8 +47,8 @@ public override void WriteToStream(Stream s, IEnumerable triangles) } var w = new StreamWriter(s, new UTF8Encoding(false, true), 1024); // do not dispose this reader as it would dispose the stream - WriteTo(w, triangles); + w.Flush(); } public string Write(IEnumerable triangles) diff --git a/GenericStl/BinaryStlWriter.cs b/GenericStl/BinaryStlWriter.cs index 471416d..2223287 100644 --- a/GenericStl/BinaryStlWriter.cs +++ b/GenericStl/BinaryStlWriter.cs @@ -77,6 +77,7 @@ public void WriteToStream(Stream s, IEnumerable triangles, byte[] hea s.Seek(HeaderLengthInByte, SeekOrigin.Begin); WriteLength(w, length); + w.Flush(); } private static byte[] PrepareHeader(byte[] header)