Data contiguity in an array in Java
<p>I'm trying to see if any series of data, beginning at array position 0, is contiguous in the sense that array[0] has a numerical value of 0, array[1] has a numerical value of 1, and so on. For example:</p>

<pre><code>    private void isContiguous(int[] array, int position){
        for(int i = 1; i &lt; array.length; i ++){
            if(!array[i].equals(null)){
                long previous = this.extract_long(array[i - 1], OFFSET);
                long current = this.extract_long(array[i], OFFSET);
                    if((previousOffset/PACKET_LENGTH) &lt; ){

                }
            }
        }
    }
</code></pre>

<p>is about as far as I can think of for a general solution. This is kinda bending my mind so it'd be nice to have some help :)</p>
