public Optional<Entry<K, V>> findFirstMatchingKeyBytes(final Txn<ByteBuffer> txn,
                                                           final KeyRange<K> keyRange,
                                                           final Predicate<ByteBuffer> keyPredicate) {

        try (final PooledByteBuffer startKeyPooledBuffer = getPooledKeyBuffer();
                final PooledByteBuffer stopKeyPooledBuffer = getPooledKeyBuffer()) {

            final KeyRange<ByteBuffer> serialisedKeyRange = serialiseKeyRange(startKeyPooledBuffer,
                    stopKeyPooledBuffer,
                    keyRange);

            return streamEntriesAsBytes(txn, serialisedKeyRange, entryStream ->
                    entryStream
                            .filter(keyVal ->
                                    keyPredicate.test(keyVal.key()))
                            .map(this::deserializeKeyVal)
                            .findFirst());
        }
    }
Find the first entry matching the supplied key buffer predicate in the supplied key range.
Only de-serialises matched entries.
stroom-lmdb/src/main/java/stroom/lmdb/AbstractLmdbDb.java