code: protected void setKey(BitArray key) {
          this.bitStringKey = (BitArray)key.clone();
  
          /*
           * Do this to keep the byte array form consistent with
           * this. Can delete when byte[] key is deleted.
           */
          this.key = key.toByteArray();
          int remaining = key.length() % 8;
          this.unusedBits =
              ((remaining == 0) ? 0 : 8 - remaining);
      }
docs: Sets the key in the BitArray form.