Reliably convert any object to String and then back again

后端 未结 7 794
名媛妹妹
名媛妹妹 2020-12-02 13:35

Is there a reliable way to convert any object to a String and then back again to the same Object? I\'ve seen some examples of people converting them using toString()

7条回答
  •  孤城傲影
    2020-12-02 14:03

    Serialize to byte array, convert to Base64. Then decode Base64 back to byte array and deserialize.

提交回复
热议问题