I am reading in a file which is in binary form, and has been ouputted from a machine which uses big endian format. I need to get the information into little endian format.

I am reading in a long, and know how to get it either as a big endian long, or as a set of 4 bytes, but dont know how to go from this point, to forming the little endian long.

Please help me!