From e6b6323263a42974907b539a036046a2f7b4ea35 Mon Sep 17 00:00:00 2001 From: Kuba Szostak Date: Sun, 30 Jun 2024 15:29:43 +0200 Subject: [PATCH] Do not close projection stream. Fix #48. --- .../Shapefiles/Writers/ShapefileWriter.T.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NetTopologySuite.IO.Esri.Shapefile/Shapefiles/Writers/ShapefileWriter.T.cs b/src/NetTopologySuite.IO.Esri.Shapefile/Shapefiles/Writers/ShapefileWriter.T.cs index c70b8a0..41fe241 100644 --- a/src/NetTopologySuite.IO.Esri.Shapefile/Shapefiles/Writers/ShapefileWriter.T.cs +++ b/src/NetTopologySuite.IO.Esri.Shapefile/Shapefiles/Writers/ShapefileWriter.T.cs @@ -13,6 +13,7 @@ namespace NetTopologySuite.IO.Esri.Shapefiles.Writers /// public abstract class ShapefileWriter : ShapefileWriter where T : Geometry { + private const int StreamBufferSize = 1024; private readonly ShpWriter ShpWriter; /// @@ -55,7 +56,7 @@ internal ShapefileWriter(Stream shpStream, Stream shxStream, Stream dbfStream, S if (!string.IsNullOrWhiteSpace(options.Projection) && prjStream != null) { - using (var writer = new StreamWriter(prjStream)) + using (var writer = new StreamWriter(prjStream, options.Encoding, StreamBufferSize, true)) { writer.Write(options.Projection); }