(ctx *ReadContext, value reflect.Value)
| 597 | } |
| 598 | |
| 599 | func (s uint16ArraySerializer) ReadData(ctx *ReadContext, value reflect.Value) { |
| 600 | buf := ctx.Buffer() |
| 601 | err := ctx.Err() |
| 602 | size := ctx.ReadBinaryLength() |
| 603 | length, ok := checkWireArraySize(ctx, size, 2, value) |
| 604 | if !ok { |
| 605 | return |
| 606 | } |
| 607 | if length > 0 { |
| 608 | if isLittleEndian { |
| 609 | ptr := value.Addr().UnsafePointer() |
| 610 | buf.Read(unsafe.Slice((*byte)(ptr), size)) |
| 611 | } else { |
| 612 | for i := 0; i < length; i++ { |
| 613 | value.Index(i).SetUint(uint64(uint16(buf.ReadInt16(err)))) |
| 614 | } |
| 615 | } |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | func (s uint16ArraySerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) { |
| 620 | done := readArrayRefAndType(ctx, refMode, readType, value) |
no test coverage detected