String s = new String(dp.getData(), 0, 0, dp.getLength()); System.out.println(dp.getAddress() + " at port " + dp.getPort() + " says " + s);