From 2d43305da53ec3ed1f272bbd868ff246cd693b64 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 17 Oct 2025 10:52:43 -0700 Subject: [PATCH] CSHARP-3984: Remove BinaryConnection.DropBox - fix big-endian support --- src/MongoDB.Driver/Core/Connections/BinaryConnection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MongoDB.Driver/Core/Connections/BinaryConnection.cs b/src/MongoDB.Driver/Core/Connections/BinaryConnection.cs index a775f7dff0d..3359a33821e 100644 --- a/src/MongoDB.Driver/Core/Connections/BinaryConnection.cs +++ b/src/MongoDB.Driver/Core/Connections/BinaryConnection.cs @@ -463,7 +463,7 @@ public async Task ReceiveMessageAsync( private int GetResponseTo(IByteBuffer message) { var backingBytes = message.AccessBackingBytes(8); - return BitConverter.ToInt32(backingBytes.Array, backingBytes.Offset); + return BinaryPrimitives.ReadInt32LittleEndian(backingBytes.Array.AsSpan().Slice(backingBytes.Offset, 4)); } private void SendBuffer(OperationContext operationContext, IByteBuffer buffer)