public KeyRange<ByteBuffer> serialiseKeyRange(final PooledByteBuffer pooledStartKeyBuffer,
                                                  final PooledByteBuffer pooledStopKeyBuffer,
                                                  final KeyRange<K> keyRange) {

        final ByteBuffer startKeyBuffer;
        final ByteBuffer stopKeyBuffer;

        if (keyRange.getStart() != null) {
            serializeKey(pooledStartKeyBuffer.getByteBuffer(), keyRange.getStart());
            startKeyBuffer = pooledStartKeyBuffer.getByteBuffer();
        } else {
            startKeyBuffer = null;
        }

        if (keyRange.getStop() != null) {
            serializeKey(pooledStopKeyBuffer.getByteBuffer(), keyRange.getStop());
            stopKeyBuffer = pooledStopKeyBuffer.getByteBuffer();
        } else {
            stopKeyBuffer = null;
        }

        return new KeyRange<>(keyRange.getType(), startKeyBuffer, stopKeyBuffer);
    }
Get the bytes of the value for the given key buffer. The returned {@link ByteBuffer} should ONLY
by used while still inside the passed {@link Txn}, so if you need its contents outside of the
txn you MUST copy it.
stroom-lmdb/src/main/java/stroom/lmdb/AbstractLmdbDb.java