Skip to content

Commit

Permalink
added missing Flush() that is called by Dispose()
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Spatz committed Nov 19, 2014
1 parent 4bfcb96 commit 865ec38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GenericStl/AsciiStlWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public override void WriteToStream(Stream s, IEnumerable<TTriangle> 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<TTriangle> triangles)
Expand Down
1 change: 1 addition & 0 deletions GenericStl/BinaryStlWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void WriteToStream(Stream s, IEnumerable<TTriangle> triangles, byte[] hea

s.Seek(HeaderLengthInByte, SeekOrigin.Begin);
WriteLength(w, length);
w.Flush();
}

private static byte[] PrepareHeader(byte[] header)
Expand Down

0 comments on commit 865ec38

Please sign in to comment.