readHeader reads and validates the Fory protocol header Sets error on ctx if header is invalid (use ctx.HasError() to check)
(ctx *ReadContext)
| 814 | // readHeader reads and validates the Fory protocol header |
| 815 | // Sets error on ctx if header is invalid (use ctx.HasError() to check) |
| 816 | func 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 |
| 829 | func readHeaderSlow(ctx *ReadContext, bitmap byte) { |