code: func (bd *BinaryDecoder) ReadLong() (int64, error) {
  	var value uint64
  	var b uint8
  	var offset int
  	bufLen := int64(len(bd.buf))
  
  	for {
  		if offset == maxLongBufSize {
  			return 0, LongOverflow
  		}
  
  		if bd.pos >= bufLen {
  			return 0, InvalidLong
  		}
  
  		b = bd.buf[bd.pos]
  		value |= uint64(b&0x7F) << uint(7*offset)
  		bd.pos++
  		offset++
  
  		if b&0x80 == 0 {
  			break
  		}
  	}
  	return int64((value >> 1) ^ -(value & 1)), nil
  }
docs: // ReadLong reads a long value. Returns a decoded value and an error if it occurs.