simplify copyx, ensuring writesize is equal to readsize or buffersize