diff --git a/src/ProtoBuf.Data/ProtoDataStream.cs b/src/ProtoBuf.Data/ProtoDataStream.cs index d93a2ca..3e5a906 100644 --- a/src/ProtoBuf.Data/ProtoDataStream.cs +++ b/src/ProtoBuf.Data/ProtoDataStream.cs @@ -33,7 +33,12 @@ public class ProtoDataStream : Stream /// /// Buffer size. /// +#if NETSTANDARD2_0 + // cause netcoreapp2.0 use shared buffer they allocate buffer more than requested 80Kb + public const int DefaultBufferSize = 256 * 1024; +#else public const int DefaultBufferSize = 128 * 1024; +#endif private readonly ProtoDataWriterOptions options; private readonly ProtoDataColumnFactory columnFactory; @@ -127,8 +132,8 @@ public ProtoDataStream(IDataReader reader, int bufferSize = DefaultBufferSize) /// You should not need to change this unless you have exceptionally /// large rows or an exceptionally high number of columns. public ProtoDataStream( - IDataReader reader, - ProtoDataWriterOptions options, + IDataReader reader, + ProtoDataWriterOptions options, int bufferSize = DefaultBufferSize) { if (reader == null)