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

Method ReadRefFlag

go/fory/ref_resolver.go:433–444  ·  view source on GitHub ↗

ReadRefFlag reads the reference flag and returns: - flag: the flag value - refId: the reference ID if flag is RefFlag - needRead: true if we need to read the actual data

(ctx *ReadContext)

Source from the content-addressed store, hash-verified

431// - refId: the reference ID if flag is RefFlag
432// - needRead: true if we need to read the actual data
433func (r *RefReader) ReadRefFlag(ctx *ReadContext) (flag int8, refId int32, needRead bool) {
434 flag = ctx.RawInt8()
435 switch flag {
436 case NullFlag:
437 return flag, 0, false
438 case RefFlag:
439 refId = ctx.ReadVarint32()
440 return flag, refId, false
441 default: // RefValueFlag or NotNullValueFlag
442 return flag, 0, true
443 }
444}
445
446// Reference stores a reference for later retrieval
447func (r *RefReader) Reference(value any) {

Callers

nothing calls this directly

Calls 2

RawInt8Method · 0.45
ReadVarint32Method · 0.45

Tested by

no test coverage detected