java中一定有人遇见过byte取值为负数情况,比如0xc0对应的值-64,其实应该是192,这里就需要我们转化处理

/**
     * Description: 负数byte转正int <BR>
     * 
     * @author dsn
     * @date 2018年12月29日 下午3:29:38
     * @param b
     * @return
     * @version 1.0
     */
    public static Integer byteToInteger(Byte b) {
        return 0xff & b;
    }

  

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-12-30
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案