我使用cat /proc/pid/net/udp6
并成为:
sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops
63: 00000000000000000000000000000000:D9BF 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 1000 0 181584 2 c16e8d00 0
我知道它的结构化和00000000000000000000000000000000:D9BF
必须是本地IP。如何将其转换为普通的ip格式,如127.0.0.1?
答案 0 :(得分:1)
InetAddress a = InetAddress.getByAddress(DatatypeConverter.parseHexBinary("0A064156"));