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

Method ReadData

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

Source from the content-addressed store, hash-verified

470}
471
472func (s float64ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
473 buf := ctx.Buffer()
474 err := ctx.Err()
475 size := ctx.ReadBinaryLength()
476 length, ok := checkWireArraySize(ctx, size, 8, value)
477 if !ok {
478 return
479 }
480 if length > 0 {
481 if isLittleEndian {
482 ptr := value.Addr().UnsafePointer()
483 buf.Read(unsafe.Slice((*byte)(ptr), size))
484 } else {
485 for i := 0; i < length; i++ {
486 value.Index(i).SetFloat(buf.ReadFloat64(err))
487 }
488 }
489 }
490}
491
492func (s float64ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
493 done := readArrayRefAndType(ctx, refMode, readType, value)

Callers 1

ReadMethod · 0.95

Calls 7

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

Tested by

no test coverage detected