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

Method ReadData

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

Source from the content-addressed store, hash-verified

142}
143
144func (s int8ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
145 buf := ctx.Buffer()
146 length := ctx.ReadBinaryLength()
147 if _, ok := checkWireArraySize(ctx, length, 1, value); !ok {
148 return
149 }
150 if length > 0 {
151 // Direct memory copy - int8 is 1 byte
152 ptr := value.Addr().UnsafePointer()
153 buf.Read(unsafe.Slice((*byte)(ptr), length))
154 }
155}
156
157func (s int8ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
158 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