This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes There is any java API to to validate IP6 and IP4 Address? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "There is any java API to to validate IP6 and IP4 Address?" Watch "There is any java API to to validate IP6 and IP4 Address?" New topic
Author

There is any java API to to validate IP6 and IP4 Address?

chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Hi Folks,

I have 2 type (IP4 and IP6) Address data,which are String.
IP4 : "15.2.3.56" format
IP6: "1080:0:0:0:8:800:200C:417A" format.

I wonder if there is any java API to validate them? so I don't have to write a code to it using StringTokenize.

Thank you!

Chwang
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3884
    
  18

Take a look at the InetAddress class, in java.net.*.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: There is any java API to to validate IP6 and IP4 Address?
 
jQuery in Action, 3rd edition