How does this Java code work to convert an ip address?
<p>In the example code below could someone walk through a more detailed explanation of exactly what the lines below are actually doing like you'd explain it to a beginning developer.</p>

<pre><code>for (byte octet : octets) {
        result &lt;&lt;= 8;
        result |= octet &amp; 0xff;
    }



public class Example {
public static long ipToLong(InetAddress ip) {
    byte[] octets = ip.getAddress();
    long result = 0;
    for (byte octet : octets) {
        result &lt;&lt;= 8;
        result |= octet &amp; 0xff;
    }
    return result;
}

public static void main(String[] args) throws UnknownHostException {
    long ipLo = ipToLong(InetAddress.getByName("192.200.0.0"));
    long ipHi = ipToLong(InetAddress.getByName("192.255.0.0"));
    long ipToTest = ipToLong(InetAddress.getByName("192.200.3.0"));

    System.out.println(ipToTest &gt;= ipLo &amp;&amp; ipToTest &lt;= ipHi);
}
</code></pre>

<p>}</p>
