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

Function WriteInt32Slice

go/fory/slice_primitive.go:822–834  ·  view source on GitHub ↗

WriteInt32Slice writes []int32 to buffer using ARRAY protocol

(buf *ByteBuffer, value []int32)

Source from the content-addressed store, hash-verified

820
821// WriteInt32Slice writes []int32 to buffer using ARRAY protocol
822func WriteInt32Slice(buf *ByteBuffer, value []int32) {
823 size := len(value) * 4
824 buf.WriteLength(size)
825 if len(value) > 0 {
826 if isLittleEndian {
827 buf.WriteBinary(unsafe.Slice((*byte)(unsafe.Pointer(&value[0])), size))
828 } else {
829 for i := 0; i < len(value); i++ {
830 buf.WriteInt32(value[i])
831 }
832 }
833 }
834}
835
836// ReadInt32Slice reads []int32 from buffer using ARRAY protocol
837func ReadInt32Slice(buf *ByteBuffer, err *Error) []int32 {

Callers 3

WriteDataMethod · 0.85
SerializeFunction · 0.85
WriteInt32SliceMethod · 0.85

Calls 4

SliceMethod · 0.80
WriteLengthMethod · 0.45
WriteBinaryMethod · 0.45
WriteInt32Method · 0.45

Tested by

no test coverage detected