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)
| 203 | // Dynamic fields store typeID + meta info (meta index or namespace/typename) in the buffer. |
| 204 | // Uses context error state for deferred error checking. |
| 205 | func 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 | |
| 223 | func readKnownTypeInfoForSkip(ctx *ReadContext, typeID uint32) *TypeInfo { |
| 224 | typeInfo := ctx.TypeResolver().readTypeInfoWithTypeID(ctx.buffer, typeID, ctx.Err()) |
no test coverage detected