Java API to find IP Address Range?

U

Unknown

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,
 
R

Roedy Green

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();
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top