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

Method Read

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

Source from the content-addressed store, hash-verified

2838}
2839
2840func (s *skipStructSerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
2841 buf := ctx.Buffer()
2842 ctxErr := ctx.Err()
2843 switch refMode {
2844 case RefModeTracking:
2845 refID, refErr := ctx.RefResolver().TryPreserveRefId(buf)
2846 if refErr != nil {
2847 ctx.SetError(FromError(refErr))
2848 return
2849 }
2850 if refID < int32(NotNullValueFlag) {
2851 // Reference found, nothing to skip
2852 return
2853 }
2854 case RefModeNullOnly:
2855 flag := buf.ReadInt8(ctxErr)
2856 if flag == NullFlag {
2857 return
2858 }
2859 }
2860 if ctx.HasError() {
2861 return
2862 }
2863 s.ReadData(ctx, value)
2864}
2865
2866func (s *skipStructSerializer) ReadWithTypeInfo(ctx *ReadContext, refMode RefMode, typeInfo *TypeInfo, value reflect.Value) {
2867 // typeInfo is already read, don't read it again - just skip data

Callers 1

ReadWithTypeInfoMethod · 0.95

Calls 10

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

Tested by

no test coverage detected