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

Function readUint16ListValues

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

Source from the content-addressed store, hash-verified

570}
571
572func readUint16ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool) []uint16 {
573 result := make([]uint16, length)
574 if !hasNull {
575 size := length * 2
576 if isLittleEndian {
577 buf.Read(unsafe.Slice((*byte)(unsafe.Pointer(&result[0])), size))
578 } else {
579 for i := 0; i < length; i++ {
580 result[i] = uint16(buf.ReadInt16(err))
581 }
582 }
583 return result
584 }
585 for i := 0; i < length; i++ {
586 if buf.ReadInt8(err) != NullFlag {
587 result[i] = uint16(buf.ReadInt16(err))
588 }
589 }
590 return result
591}
592
593func writeInt32ListValues(buf *ByteBuffer, value []int32, typeID TypeId) {
594 if typeID == INT32 {

Callers 1

readValuesMethod · 0.85

Calls 5

SliceMethod · 0.80
ReadMethod · 0.65
uint16Function · 0.50
ReadInt16Method · 0.45
ReadInt8Method · 0.45

Tested by

no test coverage detected