- if( bsz != xbuf->bsz ) { delete [] bfr; bfr = 0; }
- if( !bfr ) bfr = new unsigned char[bsz = xbuf->bsz];
- lmt = bfr + bsz;
- long ilen = xbuf->otell(), olen = xbuf->itell();
- inp = pos(ilen);
- outp = pos(olen);
- if( ilen > 0 )
- memmove(bfr, xbuf->bfr, ilen);
- destroy = xbuf->destroy;
+ xbuf->share_lock->lock("XMLBuffer::copy_from");
+ share_lock->lock("XMLBuffer::copy_from");
+ oseek(0);
+ write((const char*)xbuf->pos(0), xbuf->otell());
+ iseek(xbuf->itell());
+ xbuf->share_lock->unlock();
+ share_lock->unlock();