question: static void stringToPacket ( String s , DatagramPacket packet ) { byte [ ] bytes = s . getBytes ( ) ; System . arraycopy ( bytes , 0 , packet . getData ( ) , 0 , bytes . length ) ; packet . setLength ( bytes . length ) ; }
target:  Converts a given String into a datagram packet.