Check whether the ipAddress is in private range
<p>How would i check to see whether the ip address is in private category. </p>

<pre><code>if(isPrivateIPAddress(ipAddress)) {
// do somethign
}
</code></pre>

<p>Any suggestions will be appreciated.</p>

<p><strong>UPDATED ANSWER</strong></p>

<pre><code>private static boolean isPrivateIPAddress(String ipAddress) {

        InetAddress ia = null;

        try {
            InetAddress ad = InetAddress.getByName(ipAddress);
            byte[] ip = ad.getAddress();
            ia = InetAddress.getByAddress(ip);
        } catch (UnknownHostException e) {

            e.printStackTrace();
        }

        return ia.isSiteLocalAddress();


    }
</code></pre>

<p>I wrote this method, its working fine for me. But is there any case in which this method will not work. Just wanted to make sure it will be working for everycase.</p>
