terminate=true;
if(buf.remaining() == 0 || terminate) {
if(body == null) {
body=new byte[buf.position()];
System.arraycopy(buf.array(), buf.arrayOffset(), body, 0, buf.position());
}
else {
byte[] tmp=new byte[body.length + buf.position()];
System.arraycopy(body, 0, tmp, 0, body.length);
try {