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

Function readHeader

go/fory/fory.go:816–826  ·  view source on GitHub ↗

readHeader reads and validates the Fory protocol header Sets error on ctx if header is invalid (use ctx.HasError() to check)

(ctx *ReadContext)

Source from the content-addressed store, hash-verified

814// readHeader reads and validates the Fory protocol header
815// Sets error on ctx if header is invalid (use ctx.HasError() to check)
816func readHeader(ctx *ReadContext) {
817 err := ctx.Err()
818 bitmap := ctx.buffer.ReadByte(err)
819 if ctx.HasError() {
820 return
821 }
822 if bitmap == ctx.rootHeader {
823 return
824 }
825 readHeaderSlow(ctx, bitmap)
826}
827
828//go:noinline
829func readHeaderSlow(ctx *ReadContext, bitmap byte) {

Callers 8

DeserializeFromStreamMethod · 0.85
DeserializeFromReaderMethod · 0.85
DeserializeMethod · 0.85
DeserializeFromMethod · 0.85
DeserializeFunction · 0.85

Calls 4

readHeaderSlowFunction · 0.85
ErrMethod · 0.45
ReadByteMethod · 0.45
HasErrorMethod · 0.45