Requirement is to fetch the previous lines once you have found the searched string.
For example: if i found the searched string on line number 7, i need to go back by 2 lines and want to fetch lines 5th, 6th and 7th.
option of using LineNumberReader is not helpful, as setLineNumber(int) does not actually change the current position in the stream; it only changes the value that will be returned by getLineNumber().