Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System.IO/BinaryReader.cs')
-rw-r--r--mcs/class/corlib/System.IO/BinaryReader.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.IO/BinaryReader.cs b/mcs/class/corlib/System.IO/BinaryReader.cs
index 73235c9c23d..bbcd8174e71 100644
--- a/mcs/class/corlib/System.IO/BinaryReader.cs
+++ b/mcs/class/corlib/System.IO/BinaryReader.cs
@@ -253,6 +253,13 @@ namespace System.IO {
m_buffer [pos ++] = (byte)read_byte;
bytes_read ++;
+ if (m_encoding is UnicodeEncoding) {
+ CheckBuffer (pos + 1);
+ read_byte = m_stream.ReadByte();
+ if (read_byte != -1) {
+ m_buffer [pos++] = (byte)read_byte;
+ }
+ }
int n = m_encoding.GetChars (m_buffer, 0, pos, buffer, index + chars_read);
if (n > 0)