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

Method ReadUintSlice

go/fory/reader.go:452–471  ·  view source on GitHub ↗

ReadUintSlice reads []uint with optional ref/type info

(refMode RefMode, readType bool)

Source from the content-addressed store, hash-verified

450
451// ReadUintSlice reads []uint with optional ref/type info
452func (c *ReadContext) ReadUintSlice(refMode RefMode, readType bool) []uint {
453 err := c.Err()
454 if refMode != RefModeNone {
455 if c.buffer.ReadInt8(err) == NullFlag {
456 return nil
457 }
458 }
459 if readType {
460 actual := TypeId(c.buffer.ReadUint8(err))
461 expected := TypeId(UINT64_ARRAY)
462 if strconv.IntSize == 32 {
463 expected = UINT32_ARRAY
464 }
465 if actual != expected {
466 c.SetError(TypeMismatchError(actual, expected))
467 return nil
468 }
469 }
470 return ReadUintSlice(c.buffer, err)
471}
472
473// ReadFloat32Slice reads []float32 with optional ref/type info
474func (c *ReadContext) ReadFloat32Slice(refMode RefMode, readType bool) []float32 {

Callers 1

readRemainingFieldMethod · 0.80

Calls 7

ErrMethod · 0.95
SetErrorMethod · 0.95
TypeMismatchErrorFunction · 0.85
ReadUintSliceFunction · 0.85
ReadUint8Method · 0.80
TypeIdEnum · 0.50
ReadInt8Method · 0.45

Tested by

no test coverage detected