Rewrite conversion without memcpy.