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

Function writeIntListValues

go/fory/slice_primitive_list.go:805–818  ·  view source on GitHub ↗
(buf *ByteBuffer, value []int, typeID TypeId)

Source from the content-addressed store, hash-verified

803}
804
805func writeIntListValues(buf *ByteBuffer, value []int, typeID TypeId) {
806 if reflect.TypeOf(int(0)).Size() == 8 {
807 asInt64 := unsafe.Slice((*int64)(unsafe.Pointer(&value[0])), len(value))
808 writeInt64ListValues(buf, asInt64, typeID)
809 return
810 }
811 for _, v := range value {
812 if typeID == INT32 {
813 buf.WriteInt32(int32(v))
814 } else {
815 buf.WriteVarint32(int32(v))
816 }
817 }
818}
819
820func readIntListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []int {
821 result := make([]int, length)

Callers 1

writeValuesMethod · 0.85

Calls 5

writeInt64ListValuesFunction · 0.85
SliceMethod · 0.80
int32Function · 0.50
WriteInt32Method · 0.45
WriteVarint32Method · 0.45

Tested by

no test coverage detected