@SuppressWarnings("checkstyle:Indentation")
    public static <T> T getWithReadTxn(final LmdbEnv env,
                                       final ByteBufferPool byteBufferPool,
                                       final int requiredBufferCapacity,
                                       final BiFunction<Txn<ByteBuffer>, ByteBuffer, T> work) {
        return env.getWithReadTxn(txn ->
                byteBufferPool.getWithBuffer(requiredBufferCapacity, keyBuffer ->
                        work.apply(txn, keyBuffer)));
    }
Do work inside a read txn using a keyBuffer as supplied by the the byteBufferPool
stroom-lmdb/src/main/java/stroom/lmdb/LmdbUtils.java