Skip to content

Commit

Permalink
Fix default StreamReader buffer size for .NET Framework compat
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Jan 12, 2025
1 parent 9473cbe commit ca81737
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ private void ReadDictionaryFiles(IList<Stream> dictionaries, Encoding decoder, B
foreach (Stream dictionary in dictionaries)
{
// LUCENENET specific - CA2000: Use using pattern to ensure reader is disposed, although we want to leave the dictionary stream open. See: TestDictionary.TestResourceCleanup
using var lines = new StreamReader(dictionary, decoder, detectEncodingFromByteOrderMarks: true, bufferSize: -1, leaveOpen: true);
using var lines = new StreamReader(dictionary, decoder, detectEncodingFromByteOrderMarks: true, bufferSize: 1024, leaveOpen: true);
string line = lines.ReadLine(); // first line is number of entries (approximately, sometimes)

while ((line = lines.ReadLine()) != null)
Expand Down

0 comments on commit ca81737

Please sign in to comment.