public static boolean contains ( ByteBuffer buf , int position , short x , final int numRuns ) { int index = bufferedUnsignedInterleavedBinarySearch ( buf , position , 0 , numRuns , x ) ; if ( index >= 0 ) { return true ; } index = - index - 2 ; // points to preceding value, possibly -1 if ( index != - 1 ) { // possible match int offset = toIntUnsigned ( x ) - toIntUnsigned ( buf . getShort ( position + index * 2 * 2 ) ) ; int le = toIntUnsigned ( buf . getShort ( position + index * 2 * 2 + 2 ) ) ; if ( offset <= le ) { return true ; } } return false ; }
Checks whether the run container contains x .