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

Function writeFloat32ListValues

go/fory/slice_primitive_list.go:875–886  ·  view source on GitHub ↗
(buf *ByteBuffer, value []float32)

Source from the content-addressed store, hash-verified

873}
874
875func writeFloat32ListValues(buf *ByteBuffer, value []float32) {
876 size := len(value) * 4
877 if len(value) > 0 {
878 if isLittleEndian {
879 buf.WriteBinary(unsafe.Slice((*byte)(unsafe.Pointer(&value[0])), size))
880 } else {
881 for _, v := range value {
882 buf.WriteFloat32(v)
883 }
884 }
885 }
886}
887
888func readFloat32ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool) []float32 {
889 result := make([]float32, length)

Callers 1

writeValuesMethod · 0.85

Calls 3

SliceMethod · 0.80
WriteBinaryMethod · 0.45
WriteFloat32Method · 0.45

Tested by

no test coverage detected