code: 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];
      }
docs: 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.
  
  @param line
  the line number
  @return the byte offset in the file's data for the line, or -1 if the
  line is not valid