Inheritance: IDBWriterCtx
Exemple #1
0
        ReadOnlySpan <byte> ValueToByteArray(TValue value, ref SpanWriter writer)
        {
            IWriterCtx ctx = null;

            if (_valueHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr);
            }
            _valueWriter(value, ref writer, ctx);
            return(writer.GetPersistentSpanAndReset());
        }
Exemple #2
0
        ByteBuffer KeyToByteArray(TKey key)
        {
            var        writer = new ByteBufferWriter();
            IWriterCtx ctx    = null;

            if (_keyHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr, writer);
            }
            _keyWriter(key, writer, ctx);
            return(writer.Data);
        }
Exemple #3
0
        ReadOnlySpan <byte> KeyToByteArray(TKey key, ref SpanWriter writer)
        {
            writer.WriteBlock(_prefix);
            IWriterCtx ctx = null;

            if (_keyHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr);
            }
            _keyWriter(key, ref writer, ctx);
            return(writer.GetPersistentSpanAndReset());
        }
Exemple #4
0
        ReadOnlySpan <byte> ValueToByteArray(TValue value)
        {
            var        writer = new SpanWriter();
            IWriterCtx ctx    = null;

            if (_valueHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr);
            }
            _valueWriter(value, ref writer, ctx);
            return(writer.GetSpan());
        }
        ByteBuffer ValueToByteArray(TValue value)
        {
            var        writer = new ByteBufferWriter();
            IWriterCtx ctx    = null;

            if (_valueHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr, writer);
            }
            _valueWriter(value, writer, ctx);
            return(writer.Data);
        }
Exemple #6
0
        ReadOnlySpan <byte> KeyToByteArray(TKey key)
        {
            var        writer = new SpanWriter();
            IWriterCtx ctx    = null;

            if (_keyHandler.NeedsCtx())
            {
                ctx = new DBWriterCtx(_tr);
            }
            writer.WriteBlock(_prefix);
            _keyWriter(key, ref writer, ctx);
            return(writer.GetSpan());
        }