Exemplo n.º 1
0
        public Result WriteDatabaseToBuffer(Span <byte> output)
        {
            var writer = new ImkvdbWriter(output);

            writer.WriteHeader(KvDict.Count);

            foreach (KeyValuePair <TKey, TValue> entry in KvDict.OrderBy(x => x.Key))
            {
                writer.WriteEntry(entry.Key, entry.Value);
            }

            return(Result.Success);
        }
Exemplo n.º 2
0
        public Result WriteDatabaseToBuffer(Span <byte> output)
        {
            var writer = new ImkvdbWriter(output);

            writer.WriteHeader(KvDict.Count);

            foreach (KeyValuePair <TKey, byte[]> entry in KvDict.OrderBy(x => x.Key))
            {
                TKey key = entry.Key;
                writer.WriteEntry(SpanHelpers.AsByteSpan(ref key), entry.Value);
            }

            return(Result.Success);
        }