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

Method ReadData

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

Source from the content-addressed store, hash-verified

663}
664
665func (s uint32ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
666 buf := ctx.Buffer()
667 err := ctx.Err()
668 size := ctx.ReadBinaryLength()
669 length, ok := checkWireArraySize(ctx, size, 4, value)
670 if !ok {
671 return
672 }
673 if length > 0 {
674 if isLittleEndian {
675 ptr := value.Addr().UnsafePointer()
676 buf.Read(unsafe.Slice((*byte)(ptr), size))
677 } else {
678 for i := 0; i < length; i++ {
679 value.Index(i).SetUint(uint64(uint32(buf.ReadInt32(err))))
680 }
681 }
682 }
683}
684
685func (s uint32ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
686 done := readArrayRefAndType(ctx, refMode, readType, value)

Callers 1

ReadMethod · 0.95

Calls 9

checkWireArraySizeFunction · 0.85
ReadBinaryLengthMethod · 0.80
SliceMethod · 0.80
ReadMethod · 0.65
uint64Function · 0.50
uint32Function · 0.50
BufferMethod · 0.45
ErrMethod · 0.45
ReadInt32Method · 0.45

Tested by

no test coverage detected