我有一个包含字符和字母的Bytebuffer。如果我将其转换为CharBuffer,数字值将显示为奇怪的符号。我怎样才能确保它们被解释为数字?
//p is a Bytebuffer
CharBuffer cb = p.asCharBuffer();
String result = "";
String byteResult ="";
while (p.hasRemaining()) {
char c = cb.get();
result = result.concat("" + c);
byte b = p.get();
byteResult =byteResult.concat(""+b);*/
}
System.out.println("char Inhalt: " + result);
System.out.println("byte Inhalt: " + byteResult);
提前致谢!