copied input buffer to output buffer