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

Function readIntListValues

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

Source from the content-addressed store, hash-verified

818}
819
820func readIntListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []int {
821 result := make([]int, length)
822 if reflect.TypeOf(int(0)).Size() == 8 {
823 values := readInt64ListValues(buf, err, length, hasNull, typeID)
824 copy(unsafe.Slice((*int64)(unsafe.Pointer(&result[0])), length), values)
825 return result
826 }
827 for i := 0; i < length; i++ {
828 if hasNull && buf.ReadInt8(err) == NullFlag {
829 continue
830 }
831 if typeID == INT32 {
832 result[i] = int(buf.ReadInt32(err))
833 } else {
834 result[i] = int(buf.ReadVarint32(err))
835 }
836 }
837 return result
838}
839
840func writeUintListValues(buf *ByteBuffer, value []uint, typeID TypeId) {
841 if reflect.TypeOf(uint(0)).Size() == 8 {

Callers 1

readValuesMethod · 0.85

Calls 5

readInt64ListValuesFunction · 0.85
SliceMethod · 0.80
ReadInt8Method · 0.45
ReadInt32Method · 0.45
ReadVarint32Method · 0.45

Tested by

no test coverage detected