Ip adresses comparison
I am a beginner.
In a servlet, I need to know if the cllient address is between two adresses.
What is the best way to do that ?
I have done
InetAddress addr = InetAddress.getByName("hostname1");
byte adress_max = addr.getAddress();
addr = InetAddress.getByName("hostname2");
byte adress_min = addr.getAddress();
final InetAddress address = InetAddress.getByName(request.getRemoteHost());
final byte bytes = address.getAddress( );
and then I compare the bytes.
It works but I was wondering if there is some other way