更好的方法是使用Java 1.7中引入的 StandardCharsets 类,如下所示。 byte[] byteArr = str.getBytes(StandardCharsets.UTF_8);. 这是在Java中将String转换为字节数组的 ...
確定! 回上一頁