docs: public void appendBits(int value, int numBits) {
      if (numBits < 0 || numBits > 32) {
        throw new IllegalArgumentException("Num bits must be between 0 and 32");
      }
      ensureCapacity(size + numBits);
      for (int numBitsLeft = numBits; numBitsLeft > 0; numBitsLeft--) {
        appendBit(((value >> (numBitsLeft - 1)) & 0x01) == 1);
      }
    }