MCPcopy Create free account
hub / github.com/apache/fory / Read

Method Read

go/fory/extension.go:76–101  ·  view source on GitHub ↗
(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value)

Source from the content-addressed store, hash-verified

74}
75
76func (s *extensionSerializerAdapter) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
77 _ = hasGenerics // not used for extension serializers
78 buf := ctx.Buffer()
79 ctxErr := ctx.Err()
80 switch refMode {
81 case RefModeTracking:
82 refID, refErr := ctx.RefResolver().TryPreserveRefId(buf)
83 if refErr != nil {
84 ctx.SetError(FromError(refErr))
85 return
86 }
87 if refID < int32(NotNullValueFlag) {
88 obj := ctx.RefResolver().GetReadObject(refID)
89 if obj.IsValid() {
90 value.Set(obj)
91 }
92 return
93 }
94 case RefModeNullOnly:
95 flag := buf.ReadInt8(ctxErr)
96 if flag == NullFlag {
97 return
98 }
99 }
100 s.ReadData(ctx, value)
101}
102
103func (s *extensionSerializerAdapter) ReadWithTypeInfo(ctx *ReadContext, refMode RefMode, typeInfo *TypeInfo, value reflect.Value) {
104 s.Read(ctx, refMode, false, false, value)

Callers 1

ReadWithTypeInfoMethod · 0.95

Calls 11

ReadDataMethod · 0.95
FromErrorFunction · 0.85
TryPreserveRefIdMethod · 0.80
GetReadObjectMethod · 0.80
int32Function · 0.50
BufferMethod · 0.45
ErrMethod · 0.45
RefResolverMethod · 0.45
SetErrorMethod · 0.45
SetMethod · 0.45
ReadInt8Method · 0.45

Tested by

no test coverage detected