Пример #1
0
        public void Serialize(SequenceBuilder target, string key)
        {
            KeyFormatter.ThrowIfInvalidKey(key);

            var keyLength = utf8.GetByteCount(key);
            var buffer    = target.Request(keyLength).Span;

            utf8.GetBytes(key, buffer);
        }
        public void Serialize(SequenceBuilder target, string key)
        {
            KeyFormatter.ThrowIfInvalidKey(key);

            var keyLength = prefix.Length + utf8.GetByteCount(key);
            var buffer    = target.Request(keyLength).Span;

            prefix.Span.CopyTo(buffer);
            utf8.GetBytes(key, buffer.Slice(prefix.Length));
        }