Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -23,6 +23,7 @@ namespace System.IO {
using System.Globalization;
using System.Diagnostics.Contracts;
using System.Security;
using System.Buffers.Binary;
[System.Runtime.InteropServices.ComVisible(true)]
public class BinaryReader : IDisposable
@@ -243,6 +244,12 @@ namespace System.IO {
try {
int[] ints = new int[4];
Buffer.BlockCopy(m_buffer, 0, ints, 0, 16);
if (!BitConverter.IsLittleEndian) {
// We need to reverse the ints on BE
for (int i = 0; i < 4; i++) {
ints[i] = BinaryPrimitives.ReverseEndianness(ints[i]);
}
}
return new decimal(ints);
}
catch (ArgumentException e) {