public static byte[] ToBigEndianBytes(uint integer) { var union = new UIntUnion(integer); return(BitConverter.IsLittleEndian ? new[] { union.B3, union.B2, union.B1, union.B0 } : new[] { union.B0, union.B1, union.B2, union.B3 }); }
public static byte[] ToBigEndianBytes(uint integer) { var union = new UIntUnion(integer); if (BitConverter.IsLittleEndian) { return new[] { union.B3, union.B2, union.B1, union.B0 } } ; else { return new[] { union.B0, union.B1, union.B2, union.B3 } }; }