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

Method ReadData

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

Source from the content-addressed store, hash-verified

336}
337
338func (s int64ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) {
339 buf := ctx.Buffer()
340 err := ctx.Err()
341 size := ctx.ReadBinaryLength()
342 length, ok := checkWireArraySize(ctx, size, 8, value)
343 if !ok {
344 return
345 }
346 if length > 0 {
347 if isLittleEndian {
348 ptr := value.Addr().UnsafePointer()
349 buf.Read(unsafe.Slice((*byte)(ptr), size))
350 } else {
351 for i := 0; i < length; i++ {
352 value.Index(i).SetInt(buf.ReadInt64(err))
353 }
354 }
355 }
356}
357
358func (s int64ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
359 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
ReadInt64Method · 0.45

Tested by

no test coverage detected