Fix BinaryReader.ReadChars for fragmented Streams (dotnet/coreclr#26324)
authorJan Kotas <jkotas@microsoft.com>
Sat, 24 Aug 2019 17:10:00 +0000 (10:10 -0700)
committerGitHub <noreply@github.com>
Sat, 24 Aug 2019 17:10:00 +0000 (10:10 -0700)
commitfc1b67031a098da1a578f4bfc6c67ddbd1fc0080
treec8f03b3088dfc3464d3f3733d7c71bf4c8b0024f
parente39419af4b3107b65c208bcaf9caf1b1f6a9fb78
Fix BinaryReader.ReadChars for fragmented Streams (dotnet/coreclr#26324)

BinaryReader.ReadChars incorrectly read more than necessary from the underlying Stream when multi-byte characters straddled the read chunks.

Fixes https://github.com/dotnet/corefx/issues/40455

Commit migrated from https://github.com/dotnet/coreclr/commit/4e8339f0d025146a60b4fe8bba8d65dc787405c2
src/libraries/System.Private.CoreLib/src/System/IO/BinaryReader.cs
src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs