I am doing a snmp query to a device using snmp4j libraries and one of the OID table entries will contain a value of type InetAddress. The InetAddress may be ipv4 or ipv6.
For example, an ipv4 InetAddress looks like this.... "01:01:01:01". Pretty sure this equates to "220.127.116.11".
My question is in terms of Java, how do I convert "01:01:01:01" to the 4 octet dotted decimal equivalent. Same question applies to for ipv6, I don't have an ipv6 example, but I recall it was like 16 dotted numbers.
I was looking at DatatypeConverter.parseHexBinary(), but that only works if I just remove the colons. Ideas?