converting byte[] to string

后端 未结 5 1082
[愿得一人]
[愿得一人] 2021-01-13 02:51

I am having a bytearray of byte[] type having the length 17 bytes, i want to convert this to string and want to give this string for another comparison but the output i am g

5条回答
  •  不知归路
    2021-01-13 03:32

    Maybe you should specify a charset:

    String value = new String(byteArray, "UTF-8");
    

提交回复
热议问题