示例#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);
        }
示例#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);
        }