Skip to content

Commit 4e2d73c

Browse files
authored
CSHARP-3984: Remove BinaryConnection.DropBox - fix big-endian support (#1796)
1 parent 33a1986 commit 4e2d73c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Driver/Core/Connections/BinaryConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public async Task<ResponseMessage> ReceiveMessageAsync(
463463
private int GetResponseTo(IByteBuffer message)
464464
{
465465
var backingBytes = message.AccessBackingBytes(8);
466-
return BitConverter.ToInt32(backingBytes.Array, backingBytes.Offset);
466+
return BinaryPrimitives.ReadInt32LittleEndian(backingBytes.Array.AsSpan().Slice(backingBytes.Offset, 4));
467467
}
468468

469469
private void SendBuffer(OperationContext operationContext, IByteBuffer buffer)

0 commit comments

Comments
 (0)