build typed array directly