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

Function readUintListValues

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

Source from the content-addressed store, hash-verified

853}
854
855func readUintListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []uint {
856 result := make([]uint, length)
857 if reflect.TypeOf(uint(0)).Size() == 8 {
858 values := readUint64ListValues(buf, err, length, hasNull, typeID)
859 copy(unsafe.Slice((*uint64)(unsafe.Pointer(&result[0])), length), values)
860 return result
861 }
862 for i := 0; i < length; i++ {
863 if hasNull && buf.ReadInt8(err) == NullFlag {
864 continue
865 }
866 if typeID == UINT32 {
867 result[i] = uint(buf.ReadInt32(err))
868 } else {
869 result[i] = uint(buf.ReadVarUint32(err))
870 }
871 }
872 return result
873}
874
875func writeFloat32ListValues(buf *ByteBuffer, value []float32) {
876 size := len(value) * 4

Callers 1

readValuesMethod · 0.85

Calls 5

readUint64ListValuesFunction · 0.85
SliceMethod · 0.80
ReadInt8Method · 0.45
ReadInt32Method · 0.45
ReadVarUint32Method · 0.45

Tested by

no test coverage detected