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

Method ReadData

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

Source from the content-addressed store, hash-verified

536}
537
538func (s uint8ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
539 buf := ctx.Buffer()
540 length := ctx.ReadBinaryLength()
541 if _, ok := checkWireArraySize(ctx, length, 1, value); !ok {
542 return
543 }
544 if length > 0 {
545 // Direct memory copy - uint8 is 1 byte
546 ptr := value.Addr().UnsafePointer()
547 buf.Read(unsafe.Slice((*byte)(ptr), length))
548 }
549}
550
551func (s uint8ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
552 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