code: private void set(int position, boolean val) {
          // enlarge bitString if necessary
          if (position >= bitString.length) {
              boolean[] tmp = new boolean[position+1];
              System.arraycopy(bitString, 0, tmp, 0, bitString.length);
              bitString = tmp;
          }
          bitString[position] = val;
      }
docs: Set the bit at the specified position.