public static uint ToBigEndian(uint source) { if (BitConverter.IsLittleEndian) { return (uint)(source >> 24) | ((source << 8) & 0x00FF0000) | ((source >> 8) & 0x0000FF00) | (source << 24); } return source; }