(ctx *ReadContext, value reflect.Value)
| 403 | } |
| 404 | |
| 405 | func (s float32ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) { |
| 406 | buf := ctx.Buffer() |
| 407 | err := ctx.Err() |
| 408 | size := ctx.ReadBinaryLength() |
| 409 | length, ok := checkWireArraySize(ctx, size, 4, value) |
| 410 | if !ok { |
| 411 | return |
| 412 | } |
| 413 | if length > 0 { |
| 414 | if isLittleEndian { |
| 415 | ptr := value.Addr().UnsafePointer() |
| 416 | buf.Read(unsafe.Slice((*byte)(ptr), size)) |
| 417 | } else { |
| 418 | for i := 0; i < length; i++ { |
| 419 | value.Index(i).SetFloat(float64(buf.ReadFloat32(err))) |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | func (s float32ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) { |
| 426 | done := readArrayRefAndType(ctx, refMode, readType, value) |
no test coverage detected