protected synchronized void skipForward ( int eventsToSkip ) throws IOException { int offset = 0 ; for ( int i = 0 ; i < eventsToSkip ; i ++ ) { // adjust position for reading offset storage . seek ( position ) ; // read forward skip offset offset = storage . readInt ( ) ; // set file pointer to next event position position += offset ; // adjust index index ++ ; } }
Repositions the position of the data access layer to skip the specified number of records towards the end of the file .