java -如何将一部分字节数组附加到StringBuilder
Java下的对象?我有一段从 InputStream 读取到字节数组的函数。然后我想将我读到的任何内容附加到 StringBuilder 对象中:
byte[] buffer = new byte[4096];
InputStream is;
//
//some setup code
//
while (is.available() > 0)
{
int len = is.read(buffer);
//I want to append buffer[0] to buffer[len] into StringBuilder at this point
}