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

Method ReadData

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

Source from the content-addressed store, hash-verified

728}
729
730func (s uint64ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
731 buf := ctx.Buffer()
732 err := ctx.Err()
733 size := ctx.ReadBinaryLength()
734 length, ok := checkWireArraySize(ctx, size, 8, value)
735 if !ok {
736 return
737 }
738 if length > 0 {
739 if isLittleEndian {
740 ptr := value.Addr().UnsafePointer()
741 buf.Read(unsafe.Slice((*byte)(ptr), size))
742 } else {
743 for i := 0; i < length; i++ {
744 value.Index(i).SetUint(uint64(buf.ReadInt64(err)))
745 }
746 }
747 }
748}
749
750func (s uint64ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
751 done := readArrayRefAndType(ctx, refMode, readType, value)

Callers 1

ReadMethod · 0.95

Calls 8

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

Tested by

no test coverage detected