Google.Protobuf.EnumOptions.Serialize C# (CSharp) Method

Serialize() public static method

Serialize the instance into the stream
public static Serialize ( Stream stream, EnumOptions instance ) : void
stream Stream
instance EnumOptions
return void
        public static void Serialize(Stream stream, EnumOptions instance)
        {
            var msField = global::SilentOrbit.ProtocolBuffers.ProtocolParser.Stack.Pop();
            if (instance.AllowAlias != true)
            {
                // Key for field: 2, Varint
                stream.WriteByte(16);
                global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteBool(stream, instance.AllowAlias);
            }
            if (instance.UninterpretedOption != null)
            {
                foreach (var i999 in instance.UninterpretedOption)
                {
                    // Key for field: 999, LengthDelimited
                    stream.WriteByte(186);
                    stream.WriteByte(62);
                    msField.SetLength(0);
                    Google.Protobuf.UninterpretedOption.Serialize(msField, i999);
                    // Length delimited byte array
                    uint length999 = (uint)msField.Length;
                    global::SilentOrbit.ProtocolBuffers.ProtocolParser.WriteUInt32(stream, length999);
                    msField.WriteTo(stream);

                }
            }
            global::SilentOrbit.ProtocolBuffers.ProtocolParser.Stack.Push(msField);
        }