private void loadBytesAsNeeded ( ) throws IOException { if ( available ( ) <= 0 ) { _isEof = true ; } while ( ( ! _isEof ) && ( bytesLeftInBuffer ( ) <= 0 ) ) { _currentBufferPosition = 0 ; NfsReadResponse response = _file . read ( _offset , _bytes . length , _bytes , _currentBufferPosition ) ; _bytesInBuffer = response . getBytesRead ( ) ; _offset += _bytesInBuffer ; _isEof = response . isEof ( ) ; } }
If the buffer has no more bytes to be read and there are bytes available in the file load more bytes .