(v interface{}, basetype reflect.Type, xtag uint64, ext Ext)
| 292 | } |
| 293 | |
| 294 | func (e *msgpackEncDriver) EncodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext) { |
| 295 | var bs0, bs []byte |
| 296 | if ext == SelfExt { |
| 297 | bs0 = e.e.blist.get(1024) |
| 298 | bs = bs0 |
| 299 | e.e.sideEncode(v, basetype, &bs) |
| 300 | } else { |
| 301 | bs = ext.WriteExt(v) |
| 302 | } |
| 303 | if bs == nil { |
| 304 | e.EncodeNil() |
| 305 | goto END |
| 306 | } |
| 307 | if e.h.WriteExt { |
| 308 | e.encodeExtPreamble(uint8(xtag), len(bs)) |
| 309 | e.e.encWr.writeb(bs) |
| 310 | } else { |
| 311 | e.EncodeStringBytesRaw(bs) |
| 312 | } |
| 313 | END: |
| 314 | if ext == SelfExt { |
| 315 | e.e.blist.put(bs) |
| 316 | if !byteSliceSameData(bs0, bs) { |
| 317 | e.e.blist.put(bs0) |
| 318 | } |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | func (e *msgpackEncDriver) EncodeRawExt(re *RawExt) { |
| 323 | e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) |
nothing calls this directly
no test coverage detected