Exemplo n.º 1
0
 public static void Serialize(Stream stream, Attribute instance)
 {
     if (instance.Name == null)
     {
         throw new ArgumentNullException("Name", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Name));
     if (instance.Value == null)
     {
         throw new ArgumentNullException("Value", "Required by proto specification.");
     }
     stream.WriteByte(18);
     ProtocolParser.WriteUInt32(stream, instance.Value.GetSerializedSize());
     Variant.Serialize(stream, instance.Value);
 }
 public void Serialize(Stream stream)
 {
     Variant.Serialize(stream, this);
 }