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

Function writeUint16ListValues

go/fory/slice_primitive_list.go:559–570  ·  view source on GitHub ↗
(buf *ByteBuffer, value []uint16)

Source from the content-addressed store, hash-verified

557}
558
559func writeUint16ListValues(buf *ByteBuffer, value []uint16) {
560 size := len(value) * 2
561 if len(value) > 0 {
562 if isLittleEndian {
563 buf.WriteBinary(unsafe.Slice((*byte)(unsafe.Pointer(&value[0])), size))
564 } else {
565 for _, v := range value {
566 buf.WriteInt16(int16(v))
567 }
568 }
569 }
570}
571
572func readUint16ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool) []uint16 {
573 result := make([]uint16, length)

Callers 1

writeValuesMethod · 0.85

Calls 4

SliceMethod · 0.80
int16Function · 0.50
WriteBinaryMethod · 0.45
WriteInt16Method · 0.45

Tested by

no test coverage detected