public int getLineOffset ( int line ) { try { loadFileData ( ) ; } catch ( IOException e ) { System . err . println ( "SourceFile.getLineOffset: " + e . getMessage ( ) ) ; return - 1 ; } if ( line < 0 || line >= numLines ) { return - 1 ; } return lineNumberMap [ line ] ; }
Get the byte offset in the data for a source line . Note that lines are considered to be zero - index so the first line in the file is numbered zero .