code: public void setBit(int index, boolean b) throws IndexOutOfBoundsException {
          index = translateIndex(index);
          logger.debug("Set bit #{}", index);
          int value = ((b) ? 1 : 0);
          int byteNum = byteIndex(index);
          int bitNum = bitIndex(index);
          data[byteNum] = (byte)((data[byteNum] & ~(0x01 << bitNum))
                  | ((value & 0x01) << bitNum)
          );
      }
docs: Sets the state of the bit at the given index of
  this <tt>BitVector</tt>.
  <p>
  
  @param index the index of the bit to be set.
  @param b     true if the bit should be set, false if it should be reset.
  
  @throws IndexOutOfBoundsException if the index is out of bounds.