code: static private String parseName(char[] ch, int start, int end) {
          int len = 0;
          char[] name = new char[end - start];
  
          for (int i = start; i < end; i++) {
              switch (ch[i]) {
                  case '+':
                      // translate plus symbols to spaces
                      name[len++] = ' ';
                      break;
                  case '%':
                      // translate "%xx" to appropriate character (i.e. %20 is space)
                      if ((i + 2) < end) {
                          int num1 = Character.digit(ch[++i], 16);
                          if (-1 == num1) {
                              throw new IllegalArgumentException("" + ch[i]);
                          }
                          int num2 = Character.digit(ch[++i], 16);
                          if (-1 == num2) {
                              throw new IllegalArgumentException("" + ch[i]);
                          }
                          name[len++] = (char) ((num1 << 4) | num2);
                      } else {
                          // allow '%' at end of value or second to last character
                          for (; i < end; i++) {
                              name[len++] = ch[i];
                          }
                      }
                      break;
                  default:
                      // regular character, just save it
                      name[len++] = ch[i];
                      break;
              }
          }
          return new String(name, 0, len);
      }
docs: Parse a query parameter's name out of the input character array. This
  will undo any URLEncoding in the data (%20 is a space for example) and
  return the resulting string.
  
  Input must be in ASCII encoding.
  
  @param ch
  @param start
  @param end
  @return String
  @throws IllegalArgumentException