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

Method ReadData

go/fory/array_primitive.go:85–96  ·  view source on GitHub ↗
(ctx *ReadContext, value reflect.Value)

Source from the content-addressed store, hash-verified

83}
84
85func (s boolArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
86 buf := ctx.Buffer()
87 length := ctx.ReadBinaryLength()
88 if _, ok := checkWireArraySize(ctx, length, 1, value); !ok {
89 return
90 }
91 if length > 0 {
92 // Direct memory copy - bool is 1 byte in Go
93 ptr := value.Addr().UnsafePointer()
94 buf.Read(unsafe.Slice((*byte)(ptr), length))
95 }
96}
97
98func (s boolArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
99 done := readArrayRefAndType(ctx, refMode, readType, value)

Callers 1

ReadMethod · 0.95

Calls 5

checkWireArraySizeFunction · 0.85
ReadBinaryLengthMethod · 0.80
SliceMethod · 0.80
ReadMethod · 0.65
BufferMethod · 0.45

Tested by

no test coverage detected