code: func (p *binParser) varInt() int {
  
  	b0 := p.read()
  
  	if b0 < 0x80 {
  		return b0
  	}
  
  	if b0 < 0xc0 {
  		b1 := p.read()
  		return (b0&0x3f)<<8 | b1
  	}
  
  	if b0 < 0xe0 {
  		b1 := p.read()
  		b2 := p.read()
  		return ((b0 & 0x1f) << 16) | (b1 << 8) | b2
  	}
  
  	if b0 < 0xf0 {
  		b1 := p.read()
  		b2 := p.read()
  		b3 := p.read()
  		return ((b0 & 0x0f) << 24) | (b1 << 16) | (b2 << 8) | b3
  	}
  
  	return -1
  }
docs: // varInt is the parser production that reads a variable length integer from the stream.
  //
  // varInt ::=
  //   0x00 - 0x7F:      0xxxxxxx
  //   0x00 - 0x3FFF:    10xxxxxx xxxxxxxx
  //   0x00 - 0x1FFFFF:  110xxxxx xxxxxxxx xxxxxxxx
  //   0x00 - 0xFFFFFFF: 1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx
  //    ...