输出负数的,加这么一段就可以啦~
byte[] bytes = address.getAddress();
long[] ubytes = new long[4];
for (int i = 0; i < bytes.length; i++) {
ubytes[i] = bytes[i];
ubytes[i] &=0xff;
}
System.out.println("字节数组形式的IP: "+Arrays.toString(ubytes));
byte[] bytes = address.getAddress();
long[] ubytes = new long[4];
for (int i = 0; i < bytes.length; i++) {
ubytes[i] = bytes[i];
ubytes[i] &=0xff;
}
System.out.println("字节数组形式的IP: "+Arrays.toString(ubytes));
2016-09-10
I am server,let us begin...
The client say :UserName : admain,PassWord : 123
The client say :UserName : admain,PassWord : 123
2016-09-04
对于同一个socket,如果关闭了输入输出流,会导致与该流相对应的socket也被关闭,所以一般不需要去关闭输入输出流,直接关闭socket即可。
2016-08-29