private InetAddress getBroadcastAddress() throws IOException {
WifiManager myWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
DhcpInfo myDhcpInfo = ();
if (myDhcpInfo == null) {
("Could not get broadcast address");
return null;
}
int broadcast = ( & )
| ~;
byte[] quads = new byte[4];
for (int k = 0; k < 4; k++)
quads[k] = (byte) ((broadcast >> k * 8) & 0xFF);
return (quads);
}