|
@@ -38,12 +38,13 @@ public class Util
|
|
|
try
|
|
|
{
|
|
|
addr = java.net.InetAddress.getByName(ipAddress);
|
|
|
+ return addr.isSiteLocalAddress() || addr.isLoopbackAddress();
|
|
|
}
|
|
|
catch (UnknownHostException e)
|
|
|
{
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- return addr.isSiteLocalAddress() || addr.isLoopbackAddress();
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
public static String printData(byte[] data, int len)
|
|
@@ -68,7 +69,7 @@ public class Util
|
|
|
int charpoint = i - 15;
|
|
|
for (int a = 0; a < 16; a++)
|
|
|
{
|
|
|
- int t1 = data[charpoint++];
|
|
|
+ int t1 = 0xFF & data[charpoint++];
|
|
|
if (t1 > 0x1f && t1 < 0x80)
|
|
|
{
|
|
|
result.append((char) t1);
|
|
@@ -95,7 +96,7 @@ public class Util
|
|
|
int charpoint = data.length - rest;
|
|
|
for (int a = 0; a < rest; a++)
|
|
|
{
|
|
|
- int t1 = data[charpoint++];
|
|
|
+ int t1 = 0xFF & data[charpoint++];
|
|
|
if (t1 > 0x1f && t1 < 0x80)
|
|
|
{
|
|
|
result.append((char) t1);
|