public int getChunkId ( byte [ ] key ) { int idx = Arrays . binarySearch ( maxKeyPerChunk , 0 , filledUpTo + 1 , key , comparator ) ; idx = idx < 0 ? - idx - 1 : idx ; if ( idx > filledUpTo ) { return - 1 ; } else { return idx ; } }
returns the index of the chunk where the element could be found . If the element can t be in one of the chunks the method will return - 1 .