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

Method ReadFloat32Slice

go/fory/reader.go:474–489  ·  view source on GitHub ↗

ReadFloat32Slice reads []float32 with optional ref/type info

(refMode RefMode, readType bool)

Source from the content-addressed store, hash-verified

472
473// ReadFloat32Slice reads []float32 with optional ref/type info
474func (c *ReadContext) ReadFloat32Slice(refMode RefMode, readType bool) []float32 {
475 err := c.Err()
476 if refMode != RefModeNone {
477 if c.buffer.ReadInt8(err) == NullFlag {
478 return nil
479 }
480 }
481 if readType {
482 actual := TypeId(c.buffer.ReadUint8(err))
483 if actual != FLOAT32_ARRAY {
484 c.SetError(TypeMismatchError(actual, FLOAT32_ARRAY))
485 return nil
486 }
487 }
488 return ReadFloat32Slice(c.buffer, err)
489}
490
491// ReadFloat64Slice reads []float64 with optional ref/type info
492func (c *ReadContext) ReadFloat64Slice(refMode RefMode, readType bool) []float64 {

Callers 2

readRemainingFieldMethod · 0.80
DeserializeFunction · 0.80

Calls 7

ErrMethod · 0.95
SetErrorMethod · 0.95
TypeMismatchErrorFunction · 0.85
ReadFloat32SliceFunction · 0.85
ReadUint8Method · 0.80
TypeIdEnum · 0.50
ReadInt8Method · 0.45

Tested by

no test coverage detected