Java API to find IP Address Range?

Discussion in 'Java' started by Unknown, Jul 29, 2003.

  1. Unknown

    Unknown Guest

    Hi Folks,

    Is there any Java API/code snippet to find the list of all IP Address in
    a given range? Say example,

    if i give startIP = 192.168.254.6 and endIP = 192.168.254.8, the output
    should be,

    192.168.254.6,192.168.254.7,192.168.254.8

    I am looking if i can reuse rather than reinvent the wheel.

    Thanks for ur help,
     
    Unknown, Jul 29, 2003
    #1
    1. Advertising

  2. Unknown

    Roedy Green Guest

    On Wed, 30 Jul 2003 00:14:53 +0530, "Unknown" <> wrote or
    quoted :

    > 192.168.254.6,192.168.254.7,192.168.254.8


    these are just unsigned 32 bit binary numbers. You can enumerate them
    with a for loop.

    What you want is a way of formatting them back with octets separated
    by dots.

    See InetAddress.getHostAddress();

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mikeotp
    Replies:
    2
    Views:
    374
    Ryan Stewart
    Dec 20, 2004
  2. Replies:
    46
    Views:
    986
    Antoon Pardon
    Jul 25, 2006
  3. Lambda
    Replies:
    2
    Views:
    413
    James Kanze
    Jul 16, 2008
  4. Timothy Grant
    Replies:
    5
    Views:
    429
    Timothy Grant
    Aug 6, 2008
  5. Tomoyuki Kosimizu

    Range does not take an Range object.

    Tomoyuki Kosimizu, Nov 25, 2003, in forum: Ruby
    Replies:
    3
    Views:
    158
    Tomoyuki Kosimizu
    Nov 27, 2003
Loading...

Share This Page