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

Method ReadIntSlice

go/fory/reader.go:430–449  ·  view source on GitHub ↗

ReadIntSlice reads []int with optional ref/type info

(refMode RefMode, readType bool)

Source from the content-addressed store, hash-verified

428
429// ReadIntSlice reads []int with optional ref/type info
430func (c *ReadContext) ReadIntSlice(refMode RefMode, readType bool) []int {
431 err := c.Err()
432 if refMode != RefModeNone {
433 if c.buffer.ReadInt8(err) == NullFlag {
434 return nil
435 }
436 }
437 if readType {
438 actual := TypeId(c.buffer.ReadUint8(err))
439 expected := TypeId(INT64_ARRAY)
440 if strconv.IntSize == 32 {
441 expected = INT32_ARRAY
442 }
443 if actual != expected {
444 c.SetError(TypeMismatchError(actual, expected))
445 return nil
446 }
447 }
448 return ReadIntSlice(c.buffer, err)
449}
450
451// ReadUintSlice reads []uint with optional ref/type info
452func (c *ReadContext) ReadUintSlice(refMode RefMode, readType bool) []uint {

Callers 2

readRemainingFieldMethod · 0.80
DeserializeFunction · 0.80

Calls 7

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

Tested by

no test coverage detected