(ctx *ReadContext, value reflect.Value)
| 161 | } |
| 162 | |
| 163 | func (s primitiveListSerializer) ReadData(ctx *ReadContext, value reflect.Value) { |
| 164 | buf := ctx.Buffer() |
| 165 | err := ctx.Err() |
| 166 | length := ctx.ReadCollectionLength() |
| 167 | if ctx.HasError() { |
| 168 | return |
| 169 | } |
| 170 | if length == 0 { |
| 171 | value.Set(reflect.MakeSlice(value.Type(), 0, 0)) |
| 172 | return |
| 173 | } |
| 174 | collectFlag := buf.ReadInt8(err) |
| 175 | if ctx.HasError() { |
| 176 | return |
| 177 | } |
| 178 | if (collectFlag & CollectionIsSameType) != 0 { |
| 179 | if (collectFlag & CollectionIsDeclElementType) == 0 { |
| 180 | ctx.TypeResolver().ReadTypeInfo(buf, err) |
| 181 | } |
| 182 | } |
| 183 | if ctx.HasError() { |
| 184 | return |
| 185 | } |
| 186 | if (collectFlag & CollectionTrackingRef) != 0 { |
| 187 | ctx.SetError(DeserializationErrorf("primitive list does not support reference-tracked elements")) |
| 188 | return |
| 189 | } |
| 190 | hasNull := (collectFlag & CollectionHasNull) != 0 |
| 191 | if !s.checkBodyReadable(buf, err, length, hasNull) { |
| 192 | return |
| 193 | } |
| 194 | s.readValues(buf, err, value, length, hasNull) |
| 195 | } |
| 196 | |
| 197 | func (s compatiblePrimitiveListToArraySerializer) WriteData(ctx *WriteContext, value reflect.Value) { |
| 198 | ctx.SetError(SerializationErrorf("compatible list-to-array field serializer is read-only")) |
no test coverage detected