/** * Skips over any whitespace characters, including for end-of-lines. After this method is called, * the next input character is either an end-of-file or a non-whitespace character. This method * never causes an error. (Ordinarly, end-of-file is not possible when reading from standard * input.) */ private void skipWhitespace() { char ch = lookChar(); while (ch != EOF && Character.isWhitespace(ch)) { readChar(); ch = lookChar(); } }
/** * Skips over any whitespace characters, except for end-of-lines. After this method is called, the * next input character is either an end-of-line, an end-of-file, or a non-whitespace character. * This method never causes an error. (Ordinarly, end-of-file is not possible when reading from * standard input.) */ public void skipBlanks() { char ch = lookChar(); while (ch != EOF && ch != '\n' && Character.isWhitespace(ch)) { readChar(); ch = lookChar(); } }