if (DO_DNS_LOOKUPS)
this.hostname = java.net.InetAddress.getByAddress(host).getHostName();
else
- this.hostname = org.apache.catalina.tribes.util.Arrays.toString(host);
+ this.hostname = org.apache.catalina.tribes.util.Arrays.toString(host,0,host.length,true);
return this.hostname;
}catch ( IOException x ) {
throw new RuntimeException("Unable to parse hostname.",x);
}
public static String toString(byte[] data, int offset, int length) {
+ return toString(data,offset,length,false);
+ }
+
+ public static String toString(byte[] data, int offset, int length, boolean asInt) {
StringBuffer buf = new StringBuffer("{");
if ( data != null && length > 0 ) {
- buf.append(data[offset++]);
+ if (asInt) buf.append((int)data[offset++]);
+ else buf.append(data[offset++]);
for (int i = offset; i < length; i++) {
buf.append(", ").append(data[i]);
}
buf.append("}");
return buf.toString();
}
-
+
public static String toString(Object[] data) {
return toString(data,0,data!=null?data.length:0);
}