I\'m hacking around in some scripts trying to parse some data written by Javas DataOutputStream#writeLong(...). Since java always seems to write big endian, I have
DataOutputStream#writeLong(...)
You could use objcopy:
$ objcopy -I binary -O binary --reverse-bytes=num inputfile.bin outputfile.bin
where num is either 2 or 4.