(ctx *WriteContext, value reflect.Value, hasGenerics bool)
| 94 | } |
| 95 | |
| 96 | func (s primitiveListSerializer) writeDataWithGenerics(ctx *WriteContext, value reflect.Value, hasGenerics bool) { |
| 97 | length := value.Len() |
| 98 | buf := ctx.Buffer() |
| 99 | buf.WriteVarUint32(uint32(length)) |
| 100 | if length == 0 { |
| 101 | return |
| 102 | } |
| 103 | if hasGenerics { |
| 104 | buf.WriteInt8(CollectionDeclSameType) |
| 105 | } else { |
| 106 | buf.WriteInt8(CollectionIsSameType) |
| 107 | ctx.TypeResolver().WriteTypeInfo(buf, &TypeInfo{Type: s.type_.Elem(), TypeID: uint32(s.elemTypeID)}, ctx.Err()) |
| 108 | } |
| 109 | s.writeValues(buf, value) |
| 110 | } |
| 111 | |
| 112 | func (s primitiveListSerializer) writeValues(buf *ByteBuffer, value reflect.Value) { |
| 113 | switch s.type_.Elem().Kind() { |
no test coverage detected