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); }
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); }