From the javadoc of BufferedReader.readLine:
Returns: A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached
The code where str3 is used:
str3 = localBufferedReader1.readLine();
if (arrayOfChar3[0] == '\r')
{
n = 1;
if (str3.indexOf("SOA|OK|") >= 0) {
So your code reaches end of stream, and null
is assigned to str3. However the code doesn't seem to check it and tries to invoke indexOf
on it.