private boolean refill ( ) throws IOException { if ( ! byteBuffer . hasRemaining ( ) ) { byteBuffer . clear ( ) ; int nRead = 0 ; while ( nRead == 0 ) { nRead = fileChannel . read ( byteBuffer ) ; } if ( nRead < 0 ) { return false ; } byteBuffer . flip ( ) ; } return true ; }
Checks weather data is left to be read from the input stream .