String(byte[] bytes) 构造器
这是最简单的转换方法,它使用平台默认的字符集来解码byte数组。...(str); // 输出: Hello
String(byte[] bytes, int offset, int length) 构造器
这个方法允许你指定byte数组的子序列进行转换,通过offset...byte[] bytes = new byte[]{72, 101, 108, 108, 111, 114, 108, 100}; // "HelloWorld" in ASCII
String str...byte[] bytes = new byte[]{72, 101, 108, 108, 111, 114, 108, 100}; // "HelloWorld" in ASCII
String str...[] bytes, String charsetName) 构造器
这个构造器允许你通过字符集名称来解码byte数组。