code: public int decodeNBitUnsignedInteger(int n) throws IOException {
  		assert (n >= 0);
  
  		int bitsRead = 0;
  		int result = 0;
  
  		while (bitsRead < n) {
  			// result = (result << 8) | is.read();
  			result += (decode() << bitsRead);
  			bitsRead += 8;
  		}
  		return result;
  	}
docs: Decodes and returns an n-bit unsigned integer using the minimum number of
  bytes required for n bits.