Thaynann <Th******@discussions.microsoft.com> wrote:
im new to working with binary data, i was wondering if tehr was an easy way
to flip the values ie....f7 becomes 7f....things like that...im using c#.
Sean's mentioned a way of doing some big-endian stuff, and there's also
my EndianBitConverter which allows you to specify which endianness you
want:
http://www.pobox.com/~skeet/csharp/miscutil
However, that's not *quite* what you asked for - do you *really* want
to flip nybbles? If so, it's as simple as:
byte flipped = (byte)( (original & 0xf) << 4 |
(original & 0xf0) >> 4);
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too