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

Function writeUintListValues

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

Source from the content-addressed store, hash-verified

838}
839
840func writeUintListValues(buf *ByteBuffer, value []uint, typeID TypeId) {
841 if reflect.TypeOf(uint(0)).Size() == 8 {
842 asUint64 := unsafe.Slice((*uint64)(unsafe.Pointer(&value[0])), len(value))
843 writeUint64ListValues(buf, asUint64, typeID)
844 return
845 }
846 for _, v := range value {
847 if typeID == UINT32 {
848 buf.WriteInt32(int32(v))
849 } else {
850 buf.WriteVarUint32(uint32(v))
851 }
852 }
853}
854
855func readUintListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []uint {
856 result := make([]uint, length)

Callers 1

writeValuesMethod · 0.85

Calls 6

writeUint64ListValuesFunction · 0.85
SliceMethod · 0.80
int32Function · 0.50
uint32Function · 0.50
WriteInt32Method · 0.45
WriteVarUint32Method · 0.45

Tested by

no test coverage detected