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

Function readInt32ListValues

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

Source from the content-addressed store, hash-verified

614}
615
616func readInt32ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []int32 {
617 result := make([]int32, length)
618 if !hasNull && typeID == INT32 {
619 size := length * 4
620 if isLittleEndian {
621 buf.Read(unsafe.Slice((*byte)(unsafe.Pointer(&result[0])), size))
622 } else {
623 for i := 0; i < length; i++ {
624 result[i] = buf.ReadInt32(err)
625 }
626 }
627 return result
628 }
629 for i := 0; i < length; i++ {
630 if hasNull && buf.ReadInt8(err) == NullFlag {
631 continue
632 }
633 if typeID == INT32 {
634 result[i] = buf.ReadInt32(err)
635 } else {
636 result[i] = buf.ReadVarint32(err)
637 }
638 }
639 return result
640}
641
642func writeUint32ListValues(buf *ByteBuffer, value []uint32, typeID TypeId) {
643 if typeID == UINT32 {

Callers 1

readValuesMethod · 0.85

Calls 5

SliceMethod · 0.80
ReadMethod · 0.65
ReadInt32Method · 0.45
ReadInt8Method · 0.45
ReadVarint32Method · 0.45

Tested by

no test coverage detected