function to send nyte array with known length