可以使用getBytes()方法将String转换为byte[],例如:

String str = "hello world"; byte[] bytes = str.getBytes();

String 转byte