Java code To convert byte to Hexadecimal

后端 未结 19 2451
我寻月下人不归
我寻月下人不归 2020-11-22 17:26

I have an array of bytes. I want each byte String of that array to be converted to its corresponding hexadecimal values.

Is there any function in Java to convert a b

19条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 17:47

    BigInteger n = new BigInteger(byteArray);
    String hexa = n.toString(16));
    

提交回复
热议问题