code: func (r *reader) readBits(n uint32) uint32 {
  	for n > r.bitCount {
  		r.bitVal |= uint64(r.nextByte()) << r.bitCount
  		r.bitCount += 8
  	}
  
  	x := (r.bitVal & ((1 << n) - 1))
  	r.bitVal >>= n
  	r.bitCount -= n
  
  	return uint32(x)
  }
docs: // readBits returns the uint32 value for the given number of sequential bits