
Sending Data to a Port in UDP Format
The ByteBuffer Class (from the java.nio package) helps you to write data in UDP by converting them to the respective bytes they generally occupy. This is especially helpful when trying to control network traffic. The example code, by default, has the same computer as the destination and a port 10001