我有以下代码来经历一个充满chars
Java
bytebuffer
并构建一个string
。
StringBuilder actualString = new StringBuilder();
for(int i = 0; i < length; i++)
{
if((char)bbuf.get(i) != ' ');
{
actualString.append((char)bbuf.get(i));
System.out.println("ascii code is " + bbuf.get(i));
}
}
代码工作正常,当使用类的调用方获取bytebuffer
并循环访问调用方函数的包含位置时,当遇到