public boolean setPosition ( long position ) { try { long fileSize = reader . length ( ) ; if ( fileSize > position ) { reader . seek ( position ) ; return true ; } logger . logp ( Level . SEVERE , className , "setPosition" , "HPEL_OffsetBeyondFileSize" , new Object [ ] { file , Long . valueOf ( position ) , Long . valueOf ( fileSize ) } ) ; } catch ( IOException ex ) { logger . logp ( Level . SEVERE , className , "setPosition" , "HPEL_ErrorSettingFileOffset" , new Object [ ] { file , Long . valueOf ( position ) , ex . getMessage ( ) } ) ; // Fall through to return false. } return false ; }
Positions file stream to the location of a previously read record .