这应该工作:
int ipAddress = ....byte[] bytes = BigInteger.valueOf(ipAddress).toByteArray();InetAddress address = InetAddress.getByAddress(bytes);
您可能需要交换字节数组的顺序,但我无法弄清楚是否会以正确的顺序生成该数组。
欢迎分享,转载请注明来源:内存溢出
这应该工作:
int ipAddress = ....byte[] bytes = BigInteger.valueOf(ipAddress).toByteArray();InetAddress address = InetAddress.getByAddress(bytes);
您可能需要交换字节数组的顺序,但我无法弄清楚是否会以正确的顺序生成该数组。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)