You can see the WiFiUdp.write() method documented here:
// Write a single byte into the packet
virtual size_t write(uint8_t) =0;
// Write size bytes from buffer into the packet
virtual size_t write(const uint8_t *buffer, size_t size) =0;
You can give it a single byte or a pointer to a byte array (buffer). If you give it a byte array, you must also give the amount of bytes you want to copy into the packet.