I have a file format I'm trying to write to using C#. The format encodes integer-based RGB color values as a floating point. It also stores the values as big-endian. I found an example of what I'm trying to do, written in php, here: <http://www.colourlovers.com/ase.phps>

I can convert the endian-ness easily. I know this code is very verbose, but I'm just using it to watch the bits swap during troubleshooting.

```
    private uint SwapEndian(uint host) {
        uint ReturnValue;
        uint FirstHalf;
        uint LastHalf;
        FirstHalf = (host & 0xFFFF0000);
        FirstHalf = (FirstHalf >> 16);
        LastHalf = (host & 0x0000FFFF);
        LastHalf = (LastHalf << 16);
        ReturnValue = (FirstHalf | LastHalf);
        return ReturnValue;

    }   

```

C# won't let me perform bit-shifts on floats. Converting to an int or uint to call my SwapEndian method above loses the encoding information the file format requires. 

So, how would you take a floating point number and change its endian-ness without losing the exponent data?