Does someone have an code example on how to convert from big to little endian?

Yes, I know this issue has been coming up repeatedly but I haven't found a satisfactory answer by searching the forums.