Exemplo n.º 1
0
        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 });
        }
Exemplo n.º 2
0
        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 }
            };
        }