Skip to content

Commit

Permalink
Fix exception thrown under .NET Framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball committed Mar 12, 2024
1 parent 6fcb400 commit fbd105f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Segmenter/Common/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public static IEnumerable<string> SubGroupValues(this GroupCollection groups)

public static string ReadAllText(this Stream stream)
{
using var sr = new StreamReader(stream, encoding: Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: -1, leaveOpen: true);
using var sr = new StreamReader(stream, encoding: Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: 4096, leaveOpen: true);
return sr.ReadToEnd();
}

public static string[] ReadAllLines(this Stream stream)
{
using var sr = new StreamReader(stream, encoding: Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: -1, leaveOpen: true);
using var sr = new StreamReader(stream, encoding: Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: 4096, leaveOpen: true);

var lines = new List<string>();
while (true)
Expand Down
2 changes: 1 addition & 1 deletion test/Segmenter.Tests/Segmenter.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net472</TargetFrameworks>
<AssemblyName>JiebaNet.Segmenter.Tests</AssemblyName>
<RootNamespace>JiebaNet.Segmenter.Tests</RootNamespace>
<Description>JiebaNet.Segmenter.Tests</Description>
Expand Down

0 comments on commit fbd105f

Please sign in to comment.