Yeah, as I wrote, I already know about bswap but the question is the overall design (see last paragraphs).
bswap