How to convert Java String into byte[]?

后端 未结 8 1555
不知归路
不知归路 2020-11-22 16:00

Is there any way to convert Java String to a byte[] (not the boxed Byte[])?

In trying this:

System.ou         


        
8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 16:29

      String example = "Convert Java String";
      byte[] bytes = example.getBytes();
    

提交回复
热议问题