// move all data from another buffer to this one void CBuffer::MoveBuffer(CBuffer &buFrom) { // repeat for(;;) { // read a block from the other buffer UBYTE aub[256]; SLONG slSize = buFrom.ReadBytes(aub, sizeof(aub)); // if nothing read if (slSize<=0) { // stop return; } // write here what was read WriteBytes(&aub, slSize); } }