Google.Protobuf.MethodDescriptorProto.Deserialize C# (CSharp) 메소드

Deserialize() 공개 정적인 메소드

Takes the remaining content of the stream and deserialze it into the instance.
public static Deserialize ( Stream stream, Google instance ) : Google.Protobuf.MethodDescriptorProto
stream Stream
instance Google
리턴 Google.Protobuf.MethodDescriptorProto
        public static Google.Protobuf.MethodDescriptorProto Deserialize(Stream stream, Google.Protobuf.MethodDescriptorProto instance)
        {
            while (true)
            {
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    break;
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 LengthDelimited
                    case 10:
                        instance.Name = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 2 LengthDelimited
                    case 18:
                        instance.InputType = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 3 LengthDelimited
                    case 26:
                        instance.OutputType = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 4 LengthDelimited
                    case 34:
                        if (instance.Options == null)
                            instance.Options = Google.Protobuf.MethodOptions.DeserializeLengthDelimited(stream);
                        else
                            Google.Protobuf.MethodOptions.DeserializeLengthDelimited(stream, instance.Options);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }

Same methods

MethodDescriptorProto::Deserialize ( byte buffer, Google instance ) : Google.Protobuf.MethodDescriptorProto
MethodDescriptorProto::Deserialize ( Stream stream ) : MethodDescriptorProto
MethodDescriptorProto::Deserialize ( byte buffer ) : MethodDescriptorProto