我已经声明了两个字符串缓冲区,例如,
private StringBuffer buf = new StringBuffer(1024);
private StringBuffer bufRetro = new StringBuffer(1024);
在以下代码中,在 bufRetro = buf 之前,buf 具有适当的填充值。但是,复制后,两者都没有内容。如何从另一个设置一个stringBuffer?谢谢你。
if(this.v_Id){
buf.append(ch, start, length);
if (bufType.equals(bufOld)){
buf = bufRetro.append(buf);
}
myParsedXMLDataSet.setId(buf.toString());
bufOld = bufType;
bufRetro.delete(0, bufRetro.length());
bufRetro = buf;
Log.d("id", buf.toString());
buf.delete(0, buf.length());