public static CompareResult isKeyInRange(final ByteBuffer byteBuffer,
                                             final UID mapDefinitionUid,
                                             final long key) {
        // from = inclusive, to = exclusive

        // Create a view of just the uid part so we can do an equality check on it
//        final ByteBuffer uidPartBuffer = byteBuffer.duplicate();
//        uidPartBuffer.position(UID_OFFSET);
//        uidPartBuffer.limit(UID.UID_ARRAY_LENGTH);

        if (ByteBufferUtils.containsPrefix(byteBuffer, mapDefinitionUid.getBackingBuffer())) {
            long rangeFromInc = byteBuffer.getLong(RANGE_FROM_OFFSET);

            if (key >= rangeFromInc) {
                final long rangeToExc = byteBuffer.getLong(RANGE_TO_OFFSET);
                if (key < rangeToExc) {
                    return CompareResult.IN_RANGE;
                } else {
                    return CompareResult.ABOVE_RANGE;
                }
            } else {
                return CompareResult.BELOW_RANGE;
            }
        } else {
            return CompareResult.MAP_UID_MISMATCH;
        }
    }
< mapUid >< rangeStartInc >< rangeEndExc >
< 4 bytes >< 8 bytes >< 8 bytes >
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/serdes/RangeStoreKeySerde.java