Convert a String to a byte array and then back to the original String

后端 未结 4 2138
一整个雨季
一整个雨季 2020-12-01 07:33

Is it possible to convert a string to byte array and then convert it back to the original string in Java or Android?

My objective is to send some strings to a microc

4条回答
  •  难免孤独
    2020-12-01 08:00

    Use [String.getBytes()][1] to convert to bytes and use [String(byte[] data)][2] constructor to convert back to string.

提交回复
热议问题