find the next other letter from the current position
find the letter number from the current position
count until the char in the specified position is not a letter number or whitespace

@param c
@return String
@throws IOException
972676
protected String nextLetterNumber( int c ) throws IOException 
    {
        //StringBuilder isb = new StringBuilder();
        isb.clear();
        isb.append((char)c);
        int ch;
        while ( (ch = readNext()) != -1 ) {
            if ( StringUtil.isWhitespace(ch) ) {
                pushBack(ch);
                break;
            }
            
            if ( ! StringUtil.isLetterNumber( ch ) ) {
                pushBack(ch);
                break;
            } 
            
            isb.append((char)ch);
        }
        
        return isb.toString();
    }
1166754
public String next() throws IOException {
        String result;
        int len;
        Matcher matcher;

        while (true) {
            matcher = format.separator.matcher(buffer);
            if (matcher.find()) {
                len = matcher.end();
                if (buffer.start + len == buffer.end) {
                    // make sure we match the longest separator possible
                    if (buffer.isFull()) {
                        buffer.grow();
                    }
                    buffer.fill(reader);
                    matcher = format.separator.matcher(buffer);
                    if (!matcher.find()) {
                        throw new IllegalStateException();
                    }
                    len = matcher.end();
                }
                result = new String(buffer.chars, buffer.start, format.trim == LineFormat.Trim.NOTHING ? len : matcher.start());
                buffer.start += len;
            } else {
                if (buffer.isFull()) {
                    buffer.grow();
                }
                if (buffer.fill(reader)) {
                    continue;
                } else {
                    if (buffer.isEmpty()) {
                        // EOF
                        return null;
                    } else {
                        result = buffer.eat();
                    }
                }
            }

            // always bump, even if we don't return the line 
            line++;
            if (format.trim == LineFormat.Trim.ALL) {
                result = result.trim();
            }
            if (!format.excludes.matcher(result).matches()) {
                return result;
            }
        }
    }
1003532
protected int charGroup(char c) {
    int         result;

    result = 0;

    if ( (c >= 'a') && (c <= 'z') )
      result = 2;
    else if ( (c >= '0') && (c <= '9') )
      result = 1;

    return result;
  }
1167345
public int scanChar() throws IOException {

	// load more characters, if needed
	if (fCurrentEntity.position == fCurrentEntity.count) {
	    load(0, true);
	}

	// scan character
	int c = fCurrentEntity.ch[fCurrentEntity.position++];
	boolean external = false;
	if (c == '\n' ||
	    (c == '\r' && (external = fCurrentEntity.isExternal()))) {
	    fCurrentEntity.lineNumber++;
	    fCurrentEntity.columnNumber = 1;
	    if (fCurrentEntity.position == fCurrentEntity.count) {
		fCurrentEntity.ch[0] = (char)c;
		load(1, false);
	    }
	    if (c == '\r' && external) {
		if (fCurrentEntity.ch[fCurrentEntity.position++] != '\n') {
		    fCurrentEntity.position--;
		}
		c = '\n';
	    }
	}

	// return character that was scanned
	fCurrentEntity.columnNumber++;
	return c;
	
    }
701282
public char next() throws JSONException {
        int c;
        if (this.usePrevious) {
            this.usePrevious = false;
            c = this.previous;
        } else {
            try {
                c = this.reader.read();
            } catch (IOException exception) {
                throw new JSONException(exception);
            }
        }
        if (c <= 0) { // End of stream
            this.eof = true;
            return 0;
        }
        this.incrementIndexes(c);
        this.previous = (char) c;
        return this.previous;
    }
719338
@Override
    public int following(int offset) {
        CharacterIterator text = getText();

        // if we have no cached break positions, or if "offset" is outside the
        // range covered by the cache, then dump the cache and call our
        // inherited following() method.  This will call other methods in this
        // class that may refresh the cache.
        if (fCachedBreakPositions == null || offset < fCachedBreakPositions[0] ||
                offset >= fCachedBreakPositions[fCachedBreakPositions.length - 1]) {
            fCachedBreakPositions = null;
            return rulesFollowing(offset);
        }

        // on the other hand, if "offset" is within the range covered by the
        // cache, then just search the cache for the first break position
        // after "offset"
        else {
            fPositionInCache = 0;
            while (fPositionInCache < fCachedBreakPositions.length
                   && offset >= fCachedBreakPositions[fPositionInCache])
                ++fPositionInCache;
            text.setIndex(fCachedBreakPositions[fPositionInCache]);
            return text.getIndex();
        }
    }
886189
public String nextTo(char delimiter) throws JSONException {
		StringBuilder sb = new StringBuilder();
		for (;;) {
			char c = this.next();
			if (c == delimiter || c == 0 || c == '\n' || c == '\r') {
				if (c != 0) {
					this.back();
				}
				return sb.toString().trim();
			}
			sb.append(c);
		}
	}
810012
final boolean lookahead(char c, int n)
  {

    int pos = (m_queueMark + n);
    boolean b;

    if ((pos <= m_ops.getTokenQueueSize()) && (pos > 0)
            && (m_ops.getTokenQueueSize() != 0))
    {
      String tok = ((String) m_ops.m_tokenQueue.elementAt(pos - 1));

      b = (tok.length() == 1) ? (tok.charAt(0) == c) : false;
    }
    else
    {
      b = false;
    }

    return b;
  }
56239
public static int getOccurenceCount(char c, String s) 
    {
        int ret = 0;

        for(int i = 0; i < s.length(); i++)
        {
            if(s.charAt(i) == c)
                ++ret;
        }

        return ret;
    }
589520
private void checkHexDigit(int c) throws IOException {
        if (c >= '0' && c <= '9') {
            return;
        }
        if (c >= 'a' && c <= 'f') {
            return;
        }
        if (c >= 'A' && c <= 'F') {
            return;
        }
        // Causes the invalid escape to be skipped
        hasNextChar = true;
        nextChar = c;
        throw new IOException("Did not find four digit hex character code."
                + " line: " + lexer.getLine() + " col:" + lexer.getColumn());
    }
1043484
static int count(final String s, final char c) {

        int pos   = 0;
        int count = 0;

        if (s != null) {
            while ((pos = s.indexOf(c, pos)) > -1) {
                count++;
                pos++;
            }
        }

        return count;
    }
55137
int nextIndexOf(char c) {
        // doesn't handle scanning for surrogates
        bufferUp();
        for (int i = bufPos; i < bufLength; i++) {
            if (c == charBuf[i])
                return i - bufPos;
        }
        return -1;
    }
256980
public UnprotectedStringBuffer nextLine() throws IOException {
		if (input.endReached()) return null;
		UnprotectedStringBuffer line = new UnprotectedStringBuffer();
		boolean prevCR = false;
		do {
			try {
				char c = input.read();
				if (c == '\n') break;
				if (c == '\r' && !prevCR) {
					prevCR = true;
					continue;
				}
				if (prevCR) {
					line.append('\r');
					prevCR = false;
				}
				if (c == '\r') {
					prevCR = true;
					continue;
				}
				line.append(c);
			} catch (EOFException e) {
				break;
			}
		} while (true);
		return line;
	}
918073
protected String nextCNNumeric( char[] chars, int index ) throws IOException 
    {
        //StringBuilder isb = new StringBuilder();
        isb.clear();
        isb.append( chars[ index ]);
        ctrlMask &= ~ISegment.CHECK_CF_MASK;        //reset the fraction check mask.
        
        for ( int j = index + 1; j < chars.length; j++ ) {
            /* 
             * check and deal with '分之' if the 
             * current char is not a Chinese numeric. 
             * (try to recognize a Chinese fraction)
             * 
             * @added 2013-12-14
            */
            if ( NumericUtil.isCNNumeric(chars[j]) == -1 ) {
                if ( j + 2 < chars.length 
                        && chars[j  ] == '分' 
                        && chars[j+1] == '之'
                        /* check and make sure chars[j+2] is a chinese numeric.
                         * or error will happen on situation like '四六分之' .
                         * @added 2013-12-14 */
                        && NumericUtil.isCNNumeric(chars[j+2]) != -1 ) {
                    isb.append(chars[j++]);
                    isb.append(chars[j++]);
                    isb.append(chars[j  ]);
                    //set the chinese fraction check mask.
                    ctrlMask |= ISegment.CHECK_CF_MASK;
                    continue;
                } else {
                    break;
                }
            }
            
            //append the buffer.
            isb.append( chars[j] );
        }
        
        return isb.toString();
    }
1239884
private int countChar(String string, char c) {
        int count = 0;
        final int max = string.length();
        for (int i = 0; i < max; i++) {
            if (c == string.charAt(i)) {
                count++;
            }
        }
        return count;
    }
465795
public String readUntil(char c) throws IOException {
        if (lookaheadChar == UNDEFINED) {
            lookaheadChar = super.read();
        }
        line.clear(); // reuse
        while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) {
            line.append((char) lookaheadChar);
            if (lookaheadChar == '\n') {
                lineCounter++;
            }
            lastChar = lookaheadChar;
            lookaheadChar = super.read();
        }
        return line.toString();
    }
573627
public Number readNumber() throws IOException {
		//there should be a character left from readNextToken!
		if (currentCharacter < 0) {
			throw new IllegalStateException("Missed first digit");
		}
		
		//read sign
		boolean negative = false;
		if (currentCharacter == '-') {
			negative = true;
			currentCharacter = r.read();
		}
		
		//try to real an integer first
		long result = 0;
		while (currentCharacter >= 0) {
			if (currentCharacter >= '0' && currentCharacter <= '9') {
				result = result * 10 + currentCharacter - '0';
			} else if (currentCharacter == '.') {
				//there is a dot. read real number
				return readReal(result, negative);
			} else {
				break;
			}
			currentCharacter = r.read();
		}
		
		return negative ? -result : result;
	}