@ Override public int read ( ) throws IOException { // initalize the lookahead if ( lookaheadChar == UNDEFINED ) { lookaheadChar = super . read ( ) ; } lastChar = lookaheadChar ; if ( super . ready ( ) ) { lookaheadChar = super . read ( ) ; } else { lookaheadChar = UNDEFINED ; } if ( lastChar == ' ' ) { lineCounter ++ ; } return lastChar ; }
Reads the next char from the input stream .