private static void WriteDictionaryAsObject(WriterState writer, IDictionary <string, object> dictionary) { writer.Write((byte)SerializedType.Object); foreach (var(key, value) in dictionary.Keys.Zip(dictionary.Values)) { writer.Write((byte)EnumerableType.HasItem); writer.WriteString(key); WriteValue(writer, value); } writer.Write((byte)EnumerableType.End); }
private static void WriteMemberName(WriterState writer, string memberName) { writer.Write((byte)EnumerableType.HasItem); writer.WriteString(memberName); }