public static boolean checkForWhile(byte[] filterStringAsByteArray, int indexOfWhile)
    throws CharacterCodingException {

    try {
      if (
        filterStringAsByteArray[indexOfWhile] == ParseConstants.W
          && filterStringAsByteArray[indexOfWhile + 1] == ParseConstants.H
          && filterStringAsByteArray[indexOfWhile + 2] == ParseConstants.I
          && filterStringAsByteArray[indexOfWhile + 3] == ParseConstants.L
          && filterStringAsByteArray[indexOfWhile + 4] == ParseConstants.E
          && (indexOfWhile == 0
            || filterStringAsByteArray[indexOfWhile - 1] == ParseConstants.WHITESPACE
            || filterStringAsByteArray[indexOfWhile - 1] == ParseConstants.RPAREN
            || filterStringAsByteArray[indexOfWhile - 1] == ParseConstants.LPAREN)
          && (filterStringAsByteArray[indexOfWhile + 5] == ParseConstants.WHITESPACE
            || filterStringAsByteArray[indexOfWhile + 5] == ParseConstants.LPAREN)
      ) {
        return true;
      } else {
        return false;
      }
    } catch (ArrayIndexOutOfBoundsException e) {
      return false;
    }
  }
Checks if the current index of filter string we are on is the beginning of the keyword 'WHILE'
<p>
@param filterStringAsByteArray filter string given by the user
@param indexOfWhile            index at which an 'W' was read
@return true if the keyword 'WHILE' is at the current index
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java