public bool TryGetName(StreamId streamId, out string name)
        {
            if (streamId % 2 == 1)
            {
                throw new ArgumentOutOfRangeException(nameof(streamId), "streamId must be even");
            }

            // we divided by two when calculating the position in the stream, since we dont
            // explicitly create metastreams.
            var record = _indexReader.ReadPrepare(
                streamId: LogV3SystemStreams.StreamsCreatedStreamNumber,
                eventNumber: StreamIdConverter.ToEventNumber(streamId));

            if (record is null)
            {
                name = null;
                return(false);
            }

            if (record is not LogV3StreamRecord streamRecord)
            {
                throw new Exception($"Unexpected log record type: {record}.");
            }

            name = streamRecord.StreamName;
            return(true);
        }
        public bool TryGetLastValue(out StreamId lastValue)
        {
            var lastEventNumber = _indexReader.GetStreamLastEventNumber(LogV3SystemStreams.StreamsCreatedStreamNumber);
            var success         = ExpectedVersion.NoStream < lastEventNumber && lastEventNumber != EventNumber.DeletedStream;

            lastValue = StreamIdConverter.ToStreamId(lastEventNumber);
            return(success);
        }