public void Serializer(Stream stream, IMessageSerializer serializeHelper) { //var length = (byte)Count; serializeHelper.AddToMessageStream(stream, typeof(byte[]), serializeHelper.VarInt(Count)); var kType = typeof(TKey); var vType = typeof(TValue); foreach (var item in this) { serializeHelper.AddToMessageStream(stream, kType, item.Key); serializeHelper.AddToMessageStream(stream, vType, item.Value); } }
public void Serializer(Stream stream, IMessageSerializer serializeHelper) { //https://developers.google.com/protocol-buffers/docs/encoding serializeHelper.AddToMessageStream(stream, typeof(byte[]), serializeHelper.VarInt((int)Instance)); }