# inet::UdpDatagram

    sys::Obj
      inet::UdpDatagram

`public class UdpDatagram`

UdpDatagram is used to encapsulate the buffer of data and the IP address for sending and receiving UDP packets with a UdpSocket.

addr

  `public IpAddr addr`

  The IP address to send this packet to, or the address we received this packet from. Note this is a shared instance during receive and must be copied to a new memory location if you wish to keep it.

buf

  `public byte[] buf`

  The buffer of data to send (must never be null)

flowinfo

  `public int flowinfo`

  IPv6 address flow info

len

  `public int len`

  Number of bytes past buf+off to send or receive, after receive() specified the number of bytes actually read

off

  `public int off`

  Offset into buffer

port

  `public int port`

  The IP port for address to send or receive

scopeId

  `public int scopeId`

  IPv6 address scope ID

getSocketAddr

  `public void getSocketAddr(SocketAddr sockAddr)`

  Copy the datagram to the socket address (makes a deep copy of the host addr).

setSocketAddr

  `public void setSocketAddr(SocketAddr sockAddr)`

  Copy this address to the datagram (makes a shallow copy of the host addr).