(ctx *ReadContext, value reflect.Value)
| 72 | } |
| 73 | |
| 74 | func (s byteSliceSerializer) ReadData(ctx *ReadContext, value reflect.Value) { |
| 75 | buf := ctx.Buffer() |
| 76 | ctxErr := ctx.Err() |
| 77 | length := ctx.ReadBinaryLength() |
| 78 | if ctx.HasError() { |
| 79 | return |
| 80 | } |
| 81 | ptr := (*[]byte)(value.Addr().UnsafePointer()) |
| 82 | if length == 0 { |
| 83 | *ptr = make([]byte, 0) |
| 84 | return |
| 85 | } |
| 86 | if !buf.CheckReadable(length, ctxErr) { |
| 87 | return |
| 88 | } |
| 89 | result := make([]byte, length) |
| 90 | buf.Read(result) |
| 91 | *ptr = result |
| 92 | } |
| 93 | |
| 94 | type ByteSliceBufferObject struct { |
| 95 | data []byte |
no test coverage detected