public SerializationEntrySurrogate ReadValue(ref Reader reader, SerializerSession session, Field field)
        {
            ReferenceCodec.MarkValueField(session);
            var  result  = new SerializationEntrySurrogate();
            uint fieldId = 0;

            while (true)
            {
                var header = reader.ReadFieldHeader(session);
                if (header.IsEndBaseOrEndObject)
                {
                    break;
                }
                fieldId += header.FieldIdDelta;
                switch (fieldId)
                {
                case 0:
                    result.Name = StringCodec.ReadValue(ref reader, session, header);
                    break;

                case 1:
                    result.Value = ObjectCodec.ReadValue(ref reader, session, header);
                    break;
                }
            }

            return(result);
        }
        public SerializationEntrySurrogate ReadValue <TInput>(ref Reader <TInput> reader, Field field)
        {
            ReferenceCodec.MarkValueField(reader.Session);
            var  result  = new SerializationEntrySurrogate();
            uint fieldId = 0;

            while (true)
            {
                var header = reader.ReadFieldHeader();
                if (header.IsEndBaseOrEndObject)
                {
                    break;
                }

                fieldId += header.FieldIdDelta;
                switch (fieldId)
                {
                case 0:
                    result.Name = StringCodec.ReadValue(ref reader, header);
                    break;

                case 1:
                    result.Value = ObjectCodec.ReadValue(ref reader, header);
                    break;

                case 2:
                    result.ObjectType = TypeSerializerCodec.ReadValue(ref reader, header);
                    break;

                default:
                    reader.ConsumeUnknownField(header);
                    break;
                }
            }

            return(result);
        }