code: func (bd *BinaryDecoder) ReadInt() (int32, error) {
  	if err := checkEOF(bd.buf, bd.pos, 1); err != nil {
  		return 0, EOF
  	}
  	var value uint32
  	var b uint8
  	var offset int
  	bufLen := int64(len(bd.buf))
  
  	for {
  		if offset == maxIntBufSize {
  			return 0, IntOverflow
  		}
  
  		if bd.pos >= bufLen {
  			return 0, InvalidInt
  		}
  
  		b = bd.buf[bd.pos]
  		value |= uint32(b&0x7F) << uint(7*offset)
  		bd.pos++
  		offset++
  		if b&0x80 == 0 {
  			break
  		}
  	}
  	return int32((value >> 1) ^ -(value & 1)), nil
  }
docs: // ReadInt reads an int value. Returns a decoded value and an error if it occurs.