MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / parseExtLen

Method parseExtLen

ext.go:220–244  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

218}
219
220func (d *Decoder) parseExtLen(c byte) (int, error) {
221 switch c {
222 case msgpcode.FixExt1:
223 return 1, nil
224 case msgpcode.FixExt2:
225 return 2, nil
226 case msgpcode.FixExt4:
227 return 4, nil
228 case msgpcode.FixExt8:
229 return 8, nil
230 case msgpcode.FixExt16:
231 return 16, nil
232 case msgpcode.Ext8:
233 n, err := d.uint8()
234 return int(n), err
235 case msgpcode.Ext16:
236 n, err := d.uint16()
237 return int(n), err
238 case msgpcode.Ext32:
239 n, err := d.uint32()
240 return int(n), err
241 default:
242 return 0, fmt.Errorf("msgpack: invalid code=%x decoding ext len", c)
243 }
244}
245
246func (d *Decoder) decodeInterfaceExt(c byte) (interface{}, error) {
247 extID, extLen, err := d.extHeader(c)

Callers 2

extHeaderMethod · 0.95
skipExtMethod · 0.95

Calls 3

uint8Method · 0.95
uint16Method · 0.95
uint32Method · 0.95

Tested by

no test coverage detected