I’m trying to manually create InetAddress’s from a user entered IP number, but it asks for a byte array containing the IP or a String host name. I have neither. What exactly is the byte version of the IP, and how can I convert over? Is it merely each digit in the IP representing a different spot in the array?
The byte array would be (for IPV4) the 4 bytes of the address
aa.bb.cc.dd = new byte[] {aa,bb,cc,dd}
e.g. new byte [] {192, 168, 0 , 1}
you could also use the string form directly
e.g. just pass “192.168.0.1” as the host name.
Ah, okay, great. Thanks a lot!