灰常简单---直接上代码
public static void main(String[] args) {
//String 和 byte[] 字符串和字节数组相互转换
String str = "ming_test";
//String -> byte[]
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
System.out.println(bytes);
//byte[] -> String
String newStr = new String(bytes);
System.out.println(newStr);
}