UDP: Dynamic DatagramPacket buffer sizes
843790Mar 31 2007 — edited Apr 1 2007From what I've read of the DatagramSocket documentation, the only way to receive a DatagramPacket is to initialize the packet (and its buffer) ahead of time, and then pass it as an argument to DatagramSocket.receive(DatagramPacket).
I'm wondering why there is no option to dynamically create the DatagramPacket buffer based on the length specified in the header of the incoming packet? Since the packet length is at a well-known location it seems to me that this should be feasible (if a little less efficient).
Thanks,
JR