线程安全问题?
public static StringBuilder getFullMsg(byte buffer[], int len, InputStream is)
throws Exception
{
StringBuilder msg = new StringBuilder();
int i = 0;
for(i = is.read(buffer); i > -1; i = is.read(buffer))
{
String str = new String(buffer, 0, i);
msg.append(str);
if(msg.toString().getBytes().length == len)
break;
buffer = new byte[len - i];
}
return msg;
}
这个静态方法在多线程中调用会产生线程安全问题吗?