DatagramPacket.DatagramPacket

DatagramPacket.DatagramPacket

Class Overview | Class Members | This Package | All Packages

Syntax 1
public DatagramPacket( byte ibuf[], int ilength )
Parameters
ibuf
buffer for holding the incoming datagram.
ilength
the number of bytes to read.
Description
Constructs a DatagramPacket for receiving packets of length ilength.

The length argument must be less than or equal to ibuf.length.



Syntax 2
public DatagramPacket( byte ibuf[], int ilength, InetAddress iaddr, int iport )
Parameters
ibuf
the packet data.
ilength
the packet length.
iaddr
the destination address.
iport
the destination port number.
Description
Constructs a datagram packet for sending packets of length ilength to the specified port number on the specified host. The length argument must be less than or equal to ibuf.length.

See Also
InetAddress