V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zy2019
V2EX  ›  Java

请教以下关于字节和字符串或者整型转换的问题

  •  
  •   zy2019 · Jun 26, 2019 · 2131 views
    This topic created in 2507 days ago, the information mentioned may be changed or developed.

    比如:0x10,其中 10 的 1 在业务中指某种状态,0 为算出来的高 4 位。

    现在呢,就是能算出高四位,比如得到 1, 状态为 0,经过一顿操作得到 0x01, 用于放到数据包的字节里

    就是不清楚其中的转换的过程,或者说根本就不能这样弄?麻烦赐教一下。

    MoHen9
        1
    MoHen9  
       Jun 26, 2019 via Android
    看了几遍,还是看不懂你在问什么?

    建议你去搜一下 16 进制、10 进制、二进制之间的转换关系。
    www5070504
        2
    www5070504  
       Jun 26, 2019
    意思是要 0x10 转成 0x01 ? 我也没看懂想表达啥意思 是想弄明白 “一顿操作”的内容么
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   890 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 21:43 · PVG 05:43 · LAX 14:43 · JFK 17:43
    ♥ Do have faith in what you're doing.