How to send such complicated hex, binary protocol data accurately using java byte[]?

前端 未结 3 828
猫巷女王i
猫巷女王i 2021-01-14 02:23

I am very confused with this kind of stuffs, What should I send as final command, get always confused 8 bits to 1 byte but how do we make it? Is it only the command packet [

3条回答
  •  难免孤独
    2021-01-14 03:01

    You don't need to care about bit order because IP packets contain bytes and the lower level components make sure every byte is transferred correctly.

    Instead of System.out.println(st) I'd make a small method that prints the command buffer nicely in hexadeciaml.

提交回复
热议问题