67,513
社区成员
发帖
与我相关
我的任务
分享
int size_btCat = 0;
for(int i = 0;;i ++){
if(m_btCat[i] == 0){
size_btCat = i;
break;
}
}
//when we scan chinese code, because one chinese word need 3bytes,
//so we should get all buffer to change to the string at end
if(buffer[size - 1] == '\r'){
for(int i=0; i < size; i ++){
int tmpSize = size_btCat;
m_btCat[tmpSize + i] = buffer[i];
}
String tmpStrSec = new String(m_btCat, 0, m_btCat.length);
Arrays.fill(m_btCat,(byte)0);
postBroadcast(tmpStrSec);
}
else{
//if string is bigger than 32bytes, we should concat not only times
for(int i=0; i < size; i ++){
int tmpSize = size_btCat;
m_btCat[tmpSize + i] = buffer[i];
}
//m_strCat = m_strCat.concat(str);
}