// zone de données pour réception
ByteBuffer bb   =   ByteBuffer.wrap(new byte[512]) ;
// Création d'un objet canal UDP non attaché
DatagramChannel dc     = DatagramChannel.open() ;
// La réception attache implicitement le canal UDP et retourne
// la socket de l'émetteur
SocketAddress sender = dc.receive(bb) ;
bb.flip() ;
System.out.println(bb.remaining() + " octets reçus de " + sender + " :") ;
System.out.println(new String(bb.array(),0,bb.remaining())) ;
dc.close() ;
