private boolean readNextRow ( ) { while ( ! stop ) { String row = getLineWrapped ( ) ; // end of stream - null indicates end of stream before we see last_seq which shouldn't // be possible but we should handle it if ( row == null || row . startsWith ( "{\"last_seq\":" ) ) { terminate ( ) ; return false ; } else if ( row . isEmpty ( ) ) { // heartbeat continue ; } setNextRow ( gson . fromJson ( row , ChangesResult . Row . class ) ) ; return true ; } // we were stopped, end of changes feed terminate ( ) ; return false ; }
Reads and sets the next feed in the stream .