code: private int scan(String string, int i, CharBuffer cb, boolean dash)
      throws Exception
    {
      char ch;
  
      cb.length(0);
  
      int strlen = string.length();
      for (; i < strlen; i++) {
        if (! Character.isWhitespace(ch = string.charAt(i)) &&
            (ch != ':' && (! dash || ch != '-')))
          break;
      }
  
      for (; i < strlen; i++) {
        if (! Character.isWhitespace(ch = string.charAt(i)) &&
            (ch != ':' && (! dash || ch != '-')))
          cb.append((char) ch);
        else
          break;
      }
  
      if (cb.length() == 0)
        throw new Exception();
  
      return i;
    }
docs: /*
  Scan to whitespace or ':'