Command-line to reverse byte order/change endianess

后端 未结 6 1248
逝去的感伤
逝去的感伤 2021-02-07 18:49

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

6条回答
  •  花落未央
    2021-02-07 19:14

    You could use objcopy:

    $ objcopy -I binary -O binary --reverse-bytes=num inputfile.bin outputfile.bin
    

    where num is either 2 or 4.

提交回复
热议问题