How to get little endian data from big endian in c# using bitConverter.ToInt32 method?

Add a reference to System.Memory nuget and use BinaryPrimitives.ReverseEndianness().

using System.Buffers.Binary;
number = BinaryPrimitives.ReverseEndianness(number);

It supports both signed and unsigned integers (byte/short/int/long).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)