我的字节数组看起来像
byte[] x = { (byte) 0xff , (byte) 0x80 };
Run Code Online (Sandbox Code Playgroud)
我如何将其转换为char数组{char [] y}其中:
y[0]='f';
y[1] ='f' and so on
Run Code Online (Sandbox Code Playgroud)
这应该可以帮助您:
byte[] data = { (byte) 0xff , (byte) 0x80 };
String text = new String(data, "UTF-8");
char[] chars = text.toCharArray();
Run Code Online (Sandbox Code Playgroud)