/// <summary>Helper: Serialize into a MemoryStream and return its byte array</summary>
 public static byte[] SerializeToBytes(UninterpretedOption instance)
 {
     using (var ms = new MemoryStream())
     {
         Serialize(ms, instance);
         return ms.ToArray();
     }
 }
 /// <summary>Helper: Serialize with a varint length prefix</summary>
 public static void SerializeLengthDelimited(Stream stream, UninterpretedOption instance)
 {
     var data = SerializeToBytes(instance);
     global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteUInt32(stream, (uint)data.Length);
     stream.Write(data, 0, data.Length);
 }
        /// <summary>Serialize the instance into the stream</summary>
        public static void Serialize(Stream stream, UninterpretedOption instance)
        {
            var bw = new BinaryWriter(stream);
            var msField = global::SilentOrbit.ProtocolBuffers.ProtocolParser.Stack.Pop();
            if (instance.Name != null)
            {
                foreach (var i2 in instance.Name)
                {
                    // Key for field: 2, LengthDelimited
                    stream.WriteByte(18);
                    ´╗┐msField.SetLength(0);
                    Google.Protobuf.UninterpretedOption.NamePart.Serialize(msField, i2);
                    // Length delimited byte array
                    uint length2 = (uint)msField.Length;
                    global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteUInt32(stream, length2);
                    msField.WriteTo(stream);

                }
            }
            if (instance.IdentifierValue != null)
            {
                // Key for field: 3, LengthDelimited
                stream.WriteByte(26);
                global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.IdentifierValue));
            }
            // Key for field: 4, Varint
            stream.WriteByte(32);
            global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteUInt64(stream, instance.PositiveIntValue);
            // Key for field: 5, Varint
            stream.WriteByte(40);
            global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteUInt64(stream,(ulong)instance.NegativeIntValue);
            // Key for field: 6, Fixed64
            stream.WriteByte(49);
            bw.Write(instance.DoubleValue);
            if (instance.StringValue != null)
            {
                // Key for field: 7, LengthDelimited
                stream.WriteByte(58);
                global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteBytes(stream, instance.StringValue);
            }
            if (instance.AggregateValue != null)
            {
                // Key for field: 8, LengthDelimited
                stream.WriteByte(66);
                global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.AggregateValue));
            }
            global::SilentOrbit.ProtocolBuffers.ProtocolParser.Stack.Push(msField);
        }
 /// <summary>Helper: put the buffer into a MemoryStream and create a new instance to deserializing into</summary>
 public static UninterpretedOption Deserialize(byte[] buffer)
 {
     var instance = new UninterpretedOption();
     using (var ms = new MemoryStream(buffer))
         Deserialize(ms, instance);
     return instance;
 }
 /// <summary>Helper: create a new instance to deserializing into</summary>
 public static UninterpretedOption DeserializeLength(Stream stream, int length)
 {
     var instance = new UninterpretedOption();
     DeserializeLength(stream, length, instance);
     return instance;
 }
 /// <summary>Helper: create a new instance to deserializing into</summary>
 public static UninterpretedOption DeserializeLengthDelimited(Stream stream)
 {
     var instance = new UninterpretedOption();
     DeserializeLengthDelimited(stream, instance);
     return instance;
 }
 /// <summary>Helper: create a new instance to deserializing into</summary>
 public static UninterpretedOption Deserialize(Stream stream)
 {
     UninterpretedOption instance = new UninterpretedOption();
     Deserialize(stream, instance);
     return instance;
 }