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

Function readUint32ListValues

go/fory/slice_primitive_list.go:665–689  ·  view source on GitHub ↗
(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId)

Source from the content-addressed store, hash-verified

663}
664
665func readUint32ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []uint32 {
666 result := make([]uint32, length)
667 if !hasNull && typeID == UINT32 {
668 size := length * 4
669 if isLittleEndian {
670 buf.Read(unsafe.Slice((*byte)(unsafe.Pointer(&result[0])), size))
671 } else {
672 for i := 0; i < length; i++ {
673 result[i] = uint32(buf.ReadInt32(err))
674 }
675 }
676 return result
677 }
678 for i := 0; i < length; i++ {
679 if hasNull && buf.ReadInt8(err) == NullFlag {
680 continue
681 }
682 if typeID == UINT32 {
683 result[i] = uint32(buf.ReadInt32(err))
684 } else {
685 result[i] = buf.ReadVarUint32(err)
686 }
687 }
688 return result
689}
690
691func writeInt64ListValues(buf *ByteBuffer, value []int64, typeID TypeId) {
692 switch typeID {

Callers 1

readValuesMethod · 0.85

Calls 6

SliceMethod · 0.80
ReadMethod · 0.65
uint32Function · 0.50
ReadInt32Method · 0.45
ReadInt8Method · 0.45
ReadVarUint32Method · 0.45

Tested by

no test coverage detected