public int read ( ) throws IOException { if ( end == endFilled ) { switch ( pages . read ( endPageIdx , endFilled ) ) { case - 1 : eof = true ; return Scanner . EOF ; case 0 : endFilled = pages . getFilled ( endPageIdx ) ; break ; case 1 : endPageIdx ++ ; end = 0 ; endPage = pages . get ( endPageIdx ) ; endFilled = pages . getFilled ( endPageIdx ) ; break ; default : throw new RuntimeException ( ) ; } } return endPage [ end ++ ] ; }
Advances the end and returns the character at this positio .