(ctx *ReadContext, value reflect.Value)
| 797 | } |
| 798 | |
| 799 | func (s float16ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) { |
| 800 | buf := ctx.Buffer() |
| 801 | ctxErr := ctx.Err() |
| 802 | size := ctx.ReadBinaryLength() |
| 803 | length, ok := checkWireArraySize(ctx, size, 2, value) |
| 804 | if !ok { |
| 805 | return |
| 806 | } |
| 807 | |
| 808 | if length > 0 { |
| 809 | if isLittleEndian { |
| 810 | ptr := value.Addr().UnsafePointer() |
| 811 | buf.Read(unsafe.Slice((*byte)(ptr), size)) |
| 812 | } else { |
| 813 | for i := 0; i < length; i++ { |
| 814 | value.Index(i).Set(reflect.ValueOf(float16.Float16FromBits(buf.ReadUint16(ctxErr)))) |
| 815 | } |
| 816 | } |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | func (s float16ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) { |
| 821 | done := readArrayRefAndType(ctx, refMode, readType, value) |
no test coverage detected