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

Function readFloat32ListValues

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

Source from the content-addressed store, hash-verified

886}
887
888func readFloat32ListValues(buf *ByteBuffer, err *Error, length int, hasNull bool) []float32 {
889 result := make([]float32, length)
890 if !hasNull {
891 size := length * 4
892 if isLittleEndian {
893 buf.Read(unsafe.Slice((*byte)(unsafe.Pointer(&result[0])), size))
894 } else {
895 for i := 0; i < length; i++ {
896 result[i] = buf.ReadFloat32(err)
897 }
898 }
899 return result
900 }
901 for i := 0; i < length; i++ {
902 if buf.ReadInt8(err) != NullFlag {
903 result[i] = buf.ReadFloat32(err)
904 }
905 }
906 return result
907}
908
909func writeFloat64ListValues(buf *ByteBuffer, value []float64) {
910 size := len(value) * 8

Callers 1

readValuesMethod · 0.85

Calls 4

SliceMethod · 0.80
ReadMethod · 0.65
ReadFloat32Method · 0.45
ReadInt8Method · 0.45

Tested by

no test coverage detected