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

Method Read

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

Source from the content-addressed store, hash-verified

149}
150
151func (s stringSerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
152 err := ctx.Err()
153 if refMode != RefModeNone {
154 // String is non-primitive, needs ref flag
155 refFlag := ctx.buffer.ReadInt8(err)
156 if refFlag == NullFlag {
157 value.SetString("")
158 return
159 }
160 }
161 if readType && !ctx.readExpectedTypeID(STRING) {
162 return
163 }
164 if ctx.HasError() {
165 return
166 }
167 s.ReadData(ctx, value)
168}
169
170func (s stringSerializer) ReadWithTypeInfo(ctx *ReadContext, refMode RefMode, typeInfo *TypeInfo, value reflect.Value) {
171 s.Read(ctx, refMode, false, false, value)

Callers 1

ReadWithTypeInfoMethod · 0.95

Calls 5

ReadDataMethod · 0.95
readExpectedTypeIDMethod · 0.80
ErrMethod · 0.45
ReadInt8Method · 0.45
HasErrorMethod · 0.45

Tested by

no test coverage detected