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

Function readTypeInfoForSkip

go/fory/skip.go:205–221  ·  view source on GitHub ↗

readTypeInfoForSkip reads type info from buffer for struct-like fields during skip. Dynamic fields store typeID + meta info (meta index or namespace/typename) in the buffer. Uses context error state for deferred error checking.

(ctx *ReadContext, fieldTypeId TypeId)

Source from the content-addressed store, hash-verified

203// Dynamic fields store typeID + meta info (meta index or namespace/typename) in the buffer.
204// Uses context error state for deferred error checking.
205func readTypeInfoForSkip(ctx *ReadContext, fieldTypeId TypeId) *TypeInfo {
206 err := ctx.Err()
207 // Read the actual typeID from buffer (Java writes typeID for struct fields)
208 typeID := uint32(ctx.buffer.ReadUint8(err))
209 if ctx.HasError() {
210 return nil
211 }
212 // Use readTypeInfoWithTypeID which handles both namespaced and non-namespaced types correctly
213 typeInfo := ctx.TypeResolver().readTypeInfoWithTypeID(ctx.buffer, typeID, err)
214 if ctx.HasError() {
215 return nil
216 }
217 if typeInfo == nil {
218 ctx.SetError(DeserializationErrorf("cannot skip type %d: type info not found", typeID))
219 }
220 return typeInfo
221}
222
223func readKnownTypeInfoForSkip(ctx *ReadContext, typeID uint32) *TypeInfo {
224 typeInfo := ctx.TypeResolver().readTypeInfoWithTypeID(ctx.buffer, typeID, ctx.Err())

Callers 1

skipValueFunction · 0.85

Calls 8

DeserializationErrorfFunction · 0.85
ReadUint8Method · 0.80
uint32Function · 0.50
ErrMethod · 0.45
HasErrorMethod · 0.45
TypeResolverMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected